VTK
9.4.20250102
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
Common
Core
vtkTemplateAliasMacro.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2
// SPDX-License-Identifier: BSD-3-Clause
27
#ifndef vtkTemplateAliasMacro_h
28
#define vtkTemplateAliasMacro_h
29
30
#include "
vtkTypeTraits.h
"
31
32
// Allow individual switching of support for each scalar size/signedness.
33
// These could be made advanced user options to be configured by CMake.
34
#define VTK_USE_INT8 1
35
#define VTK_USE_UINT8 1
36
#define VTK_USE_INT16 1
37
#define VTK_USE_UINT16 1
38
#define VTK_USE_INT32 1
39
#define VTK_USE_UINT32 1
40
#define VTK_USE_INT64 1
41
#define VTK_USE_UINT64 1
42
#define VTK_USE_FLOAT32 1
43
#define VTK_USE_FLOAT64 1
44
45
//--------------------------------------------------------------------------
46
47
// Define helper macros to switch types on and off.
48
#define vtkTemplateAliasMacroCase(typeN, call) \
49
vtkTemplateAliasMacroCase0(typeN, call, VTK_TYPE_SIZED_##typeN)
50
#define vtkTemplateAliasMacroCase0(typeN, call, sized) \
51
vtkTemplateAliasMacroCase1(typeN, call, sized)
52
#define vtkTemplateAliasMacroCase1(typeN, call, sized) \
53
vtkTemplateAliasMacroCase2(typeN, call, VTK_USE_##sized)
54
#define vtkTemplateAliasMacroCase2(typeN, call, value) \
55
vtkTemplateAliasMacroCase3(typeN, call, value)
56
#define vtkTemplateAliasMacroCase3(typeN, call, value) \
57
vtkTemplateAliasMacroCase_##value(typeN, call)
58
#define vtkTemplateAliasMacroCase_0(typeN, call) \
59
case VTK_##typeN: \
60
{ \
61
vtkGenericWarningMacro("Support for VTK_"
#typeN " not compiled."); \
62
}; \
63
break
64
#define vtkTemplateAliasMacroCase_1(typeN, call) \
65
case VTK_##typeN: \
66
{ \
67
typedef vtkTypeTraits<VTK_TYPE_NAME_##typeN>::SizedType VTK_TT; \
68
call; \
69
}; \
70
break
71
72
// Define a macro to dispatch calls to a template instantiated over
73
// the aliased scalar types.
74
#define vtkTemplateAliasMacro(call) \
75
vtkTemplateAliasMacroCase(DOUBLE, call); \
76
vtkTemplateAliasMacroCase(FLOAT, call); \
77
vtkTemplateAliasMacroCase(LONG_LONG, call); \
78
vtkTemplateAliasMacroCase(UNSIGNED_LONG_LONG, call); \
79
vtkTemplateAliasMacroCase(ID_TYPE, call); \
80
vtkTemplateAliasMacroCase(LONG, call); \
81
vtkTemplateAliasMacroCase(UNSIGNED_LONG, call); \
82
vtkTemplateAliasMacroCase(INT, call); \
83
vtkTemplateAliasMacroCase(UNSIGNED_INT, call); \
84
vtkTemplateAliasMacroCase(SHORT, call); \
85
vtkTemplateAliasMacroCase(UNSIGNED_SHORT, call); \
86
vtkTemplateAliasMacroCase(CHAR, call); \
87
vtkTemplateAliasMacroCase(SIGNED_CHAR, call); \
88
vtkTemplateAliasMacroCase(UNSIGNED_CHAR, call)
89
90
#endif
91
// VTK-HeaderTest-Exclude: vtkTemplateAliasMacro.h
vtkTypeTraits.h
Generated on Thu Jan 2 2025 09:02:52 for VTK by
1.9.7