VTK  9.3.20240419
vtkADIOS2CoreTypeTraits.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
7 #ifndef vtkADIOS2CoreTypeTraits_h
8 #define vtkADIOS2CoreTypeTraits_h
9 
10 #include "vtkType.h"
11 
12 #include "vtkIOADIOS2Module.h" // For export macro
13 
14 VTK_ABI_NAMESPACE_BEGIN
15 template <typename T>
17 {
18  static constexpr int VTKType = 0;
19 };
20 
21 template <>
22 struct NativeToVTKType<char>
23 {
24  static constexpr int VTKType = VTK_CHAR;
25 };
26 
27 template <>
28 struct NativeToVTKType<float>
29 {
30  static constexpr int VTKType = VTK_FLOAT;
31 };
32 
33 template <>
34 struct NativeToVTKType<double>
35 {
36  static constexpr int VTKType = VTK_DOUBLE;
37 };
38 
39 template <>
40 struct NativeToVTKType<int8_t>
41 {
42  static constexpr int VTKType = VTK_TYPE_INT8;
43 };
44 
45 template <>
46 struct NativeToVTKType<uint8_t>
47 {
48  static constexpr int VTKType = VTK_TYPE_UINT8;
49 };
50 
51 template <>
52 struct NativeToVTKType<int16_t>
53 {
54  static constexpr int VTKType = VTK_TYPE_INT16;
55 };
56 
57 template <>
58 struct NativeToVTKType<uint16_t>
59 {
60  static constexpr int VTKType = VTK_TYPE_UINT16;
61 };
62 
63 template <>
64 struct NativeToVTKType<int32_t>
65 {
66  static constexpr int VTKType = VTK_TYPE_INT32;
67 };
68 
69 template <>
70 struct NativeToVTKType<uint32_t>
71 {
72  static constexpr int VTKType = VTK_TYPE_UINT32;
73 };
74 
75 template <>
76 struct NativeToVTKType<int64_t>
77 {
78  static constexpr int VTKType = VTK_TYPE_INT64;
79 };
80 
81 template <>
82 struct NativeToVTKType<uint64_t>
83 {
84  static constexpr int VTKType = VTK_TYPE_UINT64;
85 };
86 
87 VTK_ABI_NAMESPACE_END
88 #endif
89 // VTK-HeaderTest-Exclude: vtkADIOS2CoreTypeTraits.h
Type traits for adios2 types(Native types) to vtk types.
static constexpr int VTKType
#define VTK_DOUBLE
Definition: vtkType.h:43
#define VTK_FLOAT
Definition: vtkType.h:42
#define VTK_CHAR
Definition: vtkType.h:33