15#ifndef vtkTypeTraits_h
16#define vtkTypeTraits_h
21VTK_ABI_NAMESPACE_BEGIN
26#define VTK_TYPE_TRAITS(type, macro, isSigned, name, print, format) \
28 struct vtkTypeTraits<type> \
31 typedef type ValueType; \
36 VTK_TYPE_ID = VTK_##macro \
38 static int VTKTypeID() \
46 return VTK_##macro##_MIN; \
52 return VTK_##macro##_MAX; \
56 static int IsSigned() \
62 typedef vtkType##name SizedType; \
65 static const char* SizedName() \
71 static const char* Name() \
77 typedef print PrintType; \
80 static const char* ParseFormat() \
87#define VTK_TYPE_NAME_FLOAT float
88#define VTK_TYPE_NAME_DOUBLE double
89#define VTK_TYPE_SIZED_FLOAT FLOAT32
90#define VTK_TYPE_SIZED_DOUBLE FLOAT64
96#define VTK_TYPE_NAME_CHAR char
97#if VTK_TYPE_CHAR_IS_SIGNED
98#define VTK_TYPE_SIZED_CHAR INT8
101#define VTK_TYPE_SIZED_CHAR UINT8
104#define VTK_TYPE_NAME_SIGNED_CHAR signed char
105#define VTK_TYPE_NAME_UNSIGNED_CHAR unsigned char
106#define VTK_TYPE_SIZED_SIGNED_CHAR INT8
107#define VTK_TYPE_SIZED_UNSIGNED_CHAR UINT8
112#define VTK_TYPE_NAME_SHORT short
113#define VTK_TYPE_NAME_UNSIGNED_SHORT unsigned short
114#define VTK_TYPE_SIZED_SHORT INT16
115#define VTK_TYPE_SIZED_UNSIGNED_SHORT UINT16
120#define VTK_TYPE_NAME_INT int
121#define VTK_TYPE_NAME_UNSIGNED_INT unsigned int
122#define VTK_TYPE_SIZED_INT INT32
123#define VTK_TYPE_SIZED_UNSIGNED_INT UINT32
128#define VTK_TYPE_NAME_LONG long
129#define VTK_TYPE_NAME_UNSIGNED_LONG unsigned long
130#if VTK_SIZEOF_LONG == 4
131#define VTK_TYPE_SIZED_LONG INT32
132#define VTK_TYPE_SIZED_UNSIGNED_LONG UINT32
134VTK_TYPE_TRAITS(
unsigned long, UNSIGNED_LONG, 0, UInt32,
unsigned long,
"%lu");
135#elif VTK_SIZEOF_LONG == 8
136#define VTK_TYPE_SIZED_LONG INT64
137#define VTK_TYPE_SIZED_UNSIGNED_LONG UINT64
139VTK_TYPE_TRAITS(
unsigned long, UNSIGNED_LONG, 0, UInt64,
unsigned long,
"%lu");
141#error "Type long is not 4 or 8 bytes in size."
145#define VTK_TYPE_NAME_LONG_LONG long long
146#define VTK_TYPE_NAME_UNSIGNED_LONG_LONG unsigned long long
147#if VTK_SIZEOF_LONG_LONG == 8
148#define VTK_TYPE_SIZED_LONG_LONG INT64
149#define VTK_TYPE_SIZED_UNSIGNED_LONG_LONG UINT64
150#define VTK_TYPE_LONG_LONG_FORMAT "%ll"
151VTK_TYPE_TRAITS(
long long, LONG_LONG, 1, Int64,
long long, VTK_TYPE_LONG_LONG_FORMAT
"d");
152VTK_TYPE_TRAITS(
unsigned long long, UNSIGNED_LONG_LONG, 0, UInt64,
unsigned long long,
153 VTK_TYPE_LONG_LONG_FORMAT
"u");
154#undef VTK_TYPE_LONG_LONG_FORMAT
156#error "Type long long is not 8 bytes in size."
161#define VTK_TYPE_NAME_ID_TYPE vtkIdType
162#if defined(VTK_USE_64BIT_IDS)
163#define VTK_TYPE_SIZED_ID_TYPE INT64
165#define VTK_TYPE_SIZED_ID_TYPE INT32
168#undef VTK_TYPE_TRAITS
Template defining traits of native types used by VTK.
#define VTK_TYPE_TRAITS(type, macro, isSigned, name, print, format)