OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
is_vtk_writable.hpp
1/*
2 * is_vtk_writable.hpp
3 *
4 * Created on: Jul 18, 2016
5 * Author: i-bird
6 */
7
8#ifndef OPENFPM_IO_SRC_VTKWRITER_IS_VTK_WRITABLE_HPP_
9#define OPENFPM_IO_SRC_VTKWRITER_IS_VTK_WRITABLE_HPP_
10
12template<typename T, bool is_w>
14{
16 typedef decltype(std::declval<T>().get_vtk(0)) type;
17};
18
20template<typename T>
21struct vtk_type<T,false>
22{
24 typedef void type;
25};
26
31template<typename ObjType, typename Sfinae = void>
32struct is_custom_vtk_writable: std::false_type {};
33
39template<typename ObjType>
40struct is_custom_vtk_writable <ObjType, typename Void< typename ObjType::is_vtk_writable >::type> : std::true_type
41{};
42
47template<typename ObjType, typename Sfinae = void>
48struct is_vtk_vector_dims: std::false_type {};
49
51template<typename ObjType, bool has_dims = is_vtk_vector_dims<ObjType>::value >
53{
55 enum
56 {
57 value = 1
58 };
59};
60
62template<typename ObjType >
63struct vtk_dims<ObjType,true>
64{
67 enum
68 {
69 value = ObjType::dims
70 };
71};
72
78template<typename ObjType>
79struct is_vtk_vector_dims<ObjType, typename Void< decltype(ObjType::dims) >::type> : std::true_type
80{};
81
83template<typename T>
85{
86 typedef T base;
87
89 enum
90 {
92 };
93};
94
96template<>
97struct is_vtk_writable<float>
98{
99 typedef float base;
100
102 enum
103 {
104 value = true
105 };
106};
107
109template<>
110struct is_vtk_writable<double>
111{
112 typedef double base;
113
115 enum
116 {
117 value = true
118 };
119};
120
122template<>
123struct is_vtk_writable<char>
124{
125 typedef char base;
126
128 enum
129 {
130 value = true
131 };
132};
133
135template<>
136struct is_vtk_writable<unsigned char>
137{
138 typedef unsigned char base;
139
141 enum
142 {
143 value = true
144 };
145};
146
148template<>
149struct is_vtk_writable<short>
150{
151 typedef short base;
152
154 enum
155 {
156 value = true
157 };
158};
159
161template<>
162struct is_vtk_writable<unsigned short>
163{
164 typedef unsigned short base;
165
167 enum
168 {
169 value = true
170 };
171};
172
174template<>
176{
177 typedef int base;
178
180 enum
181 {
182 value = true
183 };
184};
185
187template<>
188struct is_vtk_writable<unsigned int>
189{
190 typedef unsigned int base;
191
193 enum
194 {
195 value = true
196 };
197};
198
200template<>
201struct is_vtk_writable<long int>
202{
203 typedef int base;
204
206 enum
207 {
208 value = true
209 };
210};
211
213template<>
214struct is_vtk_writable<unsigned long int>
215{
216 typedef unsigned int base;
217
219 enum
220 {
221 value = true
222 };
223};
224
226template<>
227struct is_vtk_writable<bool>
228{
229 typedef bool base;
230
232 enum
233 {
234 value = true
235 };
236};
237
238#endif /* OPENFPM_IO_SRC_VTKWRITER_IS_VTK_WRITABLE_HPP_ */
Void structure.
Definition common.hpp:74
it check if the type is vtk writable
it check if the type is vtk writable
check for T to be writable
If it has not dims property defined the object is considered scalar.
void type
non writable vtk property (so void)
the vtk type
decltype(std::declval< T >().get_vtk(0)) type
get the vtk type for the property