4 #ifndef vtkDataArrayMeta_h
5 #define vtkDataArrayMeta_h
9 #include "vtkDebugRangeIterators.h"
11 #include "vtkSetGet.h"
14 #include <type_traits>
28 #if defined(VTK_DEBUG_RANGE_ITERATORS)
29 #define VTK_ITER_ASSERT(x, msg) assert((x) && msg)
31 #define VTK_ITER_ASSERT(x, msg)
34 #if (defined(VTK_ALWAYS_OPTIMIZE_ARRAY_ITERATORS) || !defined(VTK_DEBUG_RANGE_ITERATORS)) && \
35 !defined(VTK_COMPILER_MSVC) && !defined(__PPC64__)
36 #define VTK_ITER_INLINE VTK_ALWAYS_INLINE
37 #define VTK_ITER_ASSUME VTK_ASSUME_NO_ASSERT
38 #define VTK_ITER_OPTIMIZE_START VTK_ALWAYS_OPTIMIZE_START
39 #define VTK_ITER_OPTIMIZE_END VTK_ALWAYS_OPTIMIZE_END
41 #define VTK_ITER_INLINE inline
42 #define VTK_ITER_ASSUME VTK_ASSUME
43 #define VTK_ITER_OPTIMIZE_START
44 #define VTK_ITER_OPTIMIZE_END
50 VTK_ABI_NAMESPACE_BEGIN
51 template <
typename ValueType>
57 VTK_ABI_NAMESPACE_BEGIN
67 VTK_ABI_NAMESPACE_BEGIN
79 std::is_base_of_v<vtkAbstractArray, T> && !std::is_same_v<vtkAbstractArray, T>;
97 template <ComponentIdType Size>
98 struct IsValidTupleSize : std::integral_constant<bool, (Size > 0 || Size == DynamicTupleSize)>
102 template <ComponentIdType TupleSize>
107 template <ComponentIdType Size>
112 template <ComponentIdType TupleSize>
117 template <ComponentIdType S1, ComponentIdType S2>
119 : std::integral_constant<bool, (IsStaticTupleSize<S1>::value && IsStaticTupleSize<S2>::value)>
123 template <ComponentIdType S1, ComponentIdType S2,
typename T =
void>
129 template <ComponentIdType S1, ComponentIdType S2>
131 : std::integral_constant<bool, (!IsStaticTupleSize<S1>::value || !IsStaticTupleSize<S2>::value)>
135 template <ComponentIdType S1, ComponentIdType S2,
typename T =
void>
142 template <ComponentIdType TupleSize>
148 using Superclass = std::integral_constant<ComponentIdType, TupleSize>;
152 using Superclass::Superclass;
168 :
value(array->GetNumberOfComponents())
178 template <
typename ArrayType,
typename ForceValueTypeForVtkDataArray =
double>
181 using APIType =
typename ArrayType::ValueType;
183 template <
typename ForceValueTypeForVtkDataArray>
186 using APIType = ForceValueTypeForVtkDataArray;
189 VTK_ABI_NAMESPACE_END
192 VTK_ABI_NAMESPACE_BEGIN
196 template <
typename ArrayType,
typename ForceValueTypeForVtkDataArray = double,
201 VTK_ABI_NAMESPACE_END
206 VTK_ABI_NAMESPACE_BEGIN
208 template <
typename ArrayType>
212 static constexpr
bool value = std::is_base_of<vtkAOSDataArrayTemplate<APIType>, ArrayType>
::value;
215 VTK_ABI_NAMESPACE_END
218 VTK_ABI_NAMESPACE_BEGIN
221 template <
typename ArrayType>
224 VTK_ABI_NAMESPACE_END
229 #endif // vtkDataArrayMeta_h
std::enable_if_t< IsValidTupleSize< TupleSize >::value > EnableIfValidTupleSize
std::enable_if_t< IsStaticTupleSize< TupleSize >::value > EnableIfStaticTupleSize
std::enable_if_t< IsEitherTupleSizeDynamic< S1, S2 >::value, T > EnableIfEitherTupleSizeIsDynamic
typename ArrayType::ValueType APIType
Abstract superclass for all arrays.
typename detail::GetAPITypeImpl< ArrayType, ForceValueTypeForVtkDataArray >::APIType GetAPIType
VTK_ITER_INLINE GenericTupleSize() noexcept=default
std::integral_constant< bool, detail::IsAOSDataArrayImpl< ArrayType >::value > IsAOSDataArray
VTK_ITER_INLINE value_type operator()() const noexcept
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.
VTK_ITER_INLINE GenericTupleSize(vtkAbstractArray *) noexcept
std::enable_if_t< IsVtkArray< T >::value > EnableIfVtkArray
static constexpr bool value
Array-Of-Structs implementation of vtkGenericDataArray.
abstract superclass for arrays of numeric data
static constexpr ComponentIdType DynamicTupleSize
static constexpr bool value
ComponentIdType value_type
GetAPIType< ArrayType > APIType
VTK_ITER_INLINE GenericTupleSize(vtkAbstractArray *array)
VTK_ITER_INLINE GenericTupleSize() noexcept
std::enable_if_t< IsVtkDataArray< T >::value > EnableIfVtkDataArray
ForceValueTypeForVtkDataArray APIType
Compiler hint macros for assumptions and branch prediction.
typename std::enable_if< AreStaticTupleSizes< S1, S2 >::value, T >::type EnableIfStaticTupleSizes