VTK  9.3.0
vtkIndexedArray.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
3 // Funded by CEA, DAM, DIF, F-91297 Arpajon, France
4 #ifndef vtkIndexedArray_h
5 #define vtkIndexedArray_h
6 
7 #ifdef VTK_INDEXED_ARRAY_INSTANTIATING
8 #define VTK_IMPLICIT_VALUERANGE_INSTANTIATING
9 #include "vtkDataArrayPrivate.txx"
10 #endif
11 
12 #include "vtkCommonCoreModule.h" // for export macro
13 #include "vtkImplicitArray.h"
14 #include "vtkIndexedImplicitBackend.h" // for the array backend
15 
16 #ifdef VTK_INDEXED_ARRAY_INSTANTIATING
17 #undef VTK_IMPLICIT_VALUERANGE_INSTANTIATING
18 #endif
19 
20 #include <vector>
21 
56 VTK_ABI_NAMESPACE_BEGIN
57 template <typename T>
59 VTK_ABI_NAMESPACE_END
60 
61 #endif // vtkIndexedArray_h
62 
63 #ifdef VTK_INDEXED_ARRAY_INSTANTIATING
64 
65 #define VTK_INSTANTIATE_INDEXED_ARRAY(ValueType) \
66  VTK_ABI_NAMESPACE_BEGIN \
67  template class VTKCOMMONCORE_EXPORT vtkImplicitArray<vtkIndexedImplicitBackend<ValueType>>; \
68  VTK_ABI_NAMESPACE_END \
69  namespace vtkDataArrayPrivate \
70  { \
71  VTK_ABI_NAMESPACE_BEGIN \
72  VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE( \
73  vtkImplicitArray<vtkIndexedImplicitBackend<ValueType>>, double) \
74  VTK_ABI_NAMESPACE_END \
75  }
76 
77 #elif defined(VTK_USE_EXTERN_TEMPLATE)
78 #ifndef VTK_INDEXED_ARRAY_TEMPLATE_EXTERN
79 #define VTK_INDEXED_ARRAY_TEMPLATE_EXTERN
80 #ifdef _MSC_VER
81 #pragma warning(push)
82 // The following is needed when the vtkIndexedArray is declared
83 // dllexport and is used from another class in vtkCommonCore
84 #pragma warning(disable : 4910) // extern and dllexport incompatible
85 #endif
86 VTK_ABI_NAMESPACE_BEGIN
88  extern template class VTKCOMMONCORE_EXPORT vtkImplicitArray, vtkIndexedImplicitBackend);
89 #ifdef _MSC_VER
90 #pragma warning(pop)
91 #endif
92 VTK_ABI_NAMESPACE_END
93 #endif // VTK_INDEXED_ARRAY_TEMPLATE_EXTERN
94 // The following clause is only for MSVC 2008 and 2010
95 #elif defined(_MSC_VER) && !defined(VTK_BUILD_SHARED_LIBS)
96 #pragma warning(push)
97 // C4091: 'extern ' : ignored on left of 'int' when no variable is declared
98 #pragma warning(disable : 4091)
99 
100 // Compiler-specific extension warning.
101 #pragma warning(disable : 4231)
102 
103 // We need to disable warning 4910 and do an extern dllexport
104 // anyway. When deriving new arrays from an
105 // instantiation of this template the compiler does an explicit
106 // instantiation of the base class. From outside the vtkCommon
107 // library we block this using an extern dllimport instantiation.
108 // For classes inside vtkCommon we should be able to just do an
109 // extern instantiation, but VS 2008 complains about missing
110 // definitions. We cannot do an extern dllimport inside vtkCommon
111 // since the symbols are local to the dll. An extern dllexport
112 // seems to be the only way to convince VS 2008 to do the right
113 // thing, so we just disable the warning.
114 #pragma warning(disable : 4910) // extern and dllexport incompatible
115 
116 // Use an "extern explicit instantiation" to give the class a DLL
117 // interface. This is a compiler-specific extension.
118 VTK_ABI_NAMESPACE_BEGIN
120  extern template class VTKCOMMONCORE_EXPORT vtkImplicitArray, vtkIndexedImplicitBackend);
121 
122 #pragma warning(pop)
123 
124 VTK_ABI_NAMESPACE_END
125 #endif
A read only array class that wraps an implicit function from integers to any value type supported by ...
A backend for the vtkImplicitArray framework allowing one to use a subset of a given data array,...
vtkExternSecondOrderTemplateMacro(extern template class VTKCOMMONCORE_EXPORT vtkImplicitArray, vtkIndexedImplicitBackend)
#define vtkInstantiateSecondOrderTemplateMacro(decl0, decl1)
Definition: vtkType.h:378