VTK  9.5.20250910
vtkStridedArray.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#ifndef vtkStridedArray_h
4#define vtkStridedArray_h
5
6#ifdef VTK_STRIDED_ARRAY_INSTANTIATING
7#define VTK_IMPLICIT_VALUERANGE_INSTANTIATING
8#include "vtkDataArrayPrivate.txx"
9#endif
10
11#include "vtkCommonCoreModule.h" // for export macro
12#include "vtkImplicitArray.h"
13#include "vtkStridedImplicitBackend.h" // for the array backend
14
15#ifdef VTK_STRIDED_ARRAY_INSTANTIATING
16#undef VTK_IMPLICIT_VALUERANGE_INSTANTIATING
17#endif
18
71VTK_ABI_NAMESPACE_BEGIN
72template <typename T>
74VTK_ABI_NAMESPACE_END
75
76#endif // vtkStridedArray_h
77
78#ifdef VTK_STRIDED_ARRAY_INSTANTIATING
79
80#define VTK_INSTANTIATE_STRIDED_ARRAY(ValueType) \
81 VTK_ABI_NAMESPACE_BEGIN \
82 template class VTKCOMMONCORE_EXPORT vtkImplicitArray<vtkStridedImplicitBackend<ValueType>>; \
83 VTK_ABI_NAMESPACE_END \
84 namespace vtkDataArrayPrivate \
85 { \
86 VTK_ABI_NAMESPACE_BEGIN \
87 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE( \
88 vtkImplicitArray<vtkStridedImplicitBackend<ValueType>>, double) \
89 VTK_ABI_NAMESPACE_END \
90 }
91
92#elif defined(VTK_USE_EXTERN_TEMPLATE)
93#ifndef VTK_STRIDED_ARRAY_TEMPLATE_EXTERN
94#define VTK_STRIDED_ARRAY_TEMPLATE_EXTERN
95#ifdef _MSC_VER
96#pragma warning(push)
97// The following is needed when the vtkStridedArray is declared
98// dllexport and is used from another class in vtkCommonCore
99#pragma warning(disable : 4910) // extern and dllexport incompatible
100#endif
101VTK_ABI_NAMESPACE_BEGIN
103 extern template class VTKCOMMONCORE_EXPORT vtkImplicitArray, vtkStridedImplicitBackend);
104#ifdef _MSC_VER
105#pragma warning(pop)
106#endif
107VTK_ABI_NAMESPACE_END
108#endif // VTK_STRIDED_ARRAY_TEMPLATE_EXTERN
109// The following clause is only for MSVC 2008 and 2010
110#elif defined(_MSC_VER) && !defined(VTK_BUILD_SHARED_LIBS)
111#pragma warning(push)
112// C4091: 'extern ' : ignored on left of 'int' when no variable is declared
113#pragma warning(disable : 4091)
114
115// Compiler-specific extension warning.
116#pragma warning(disable : 4231)
117
118// We need to disable warning 4910 and do an extern dllexport
119// anyway. When deriving new arrays from an
120// instantiation of this template the compiler does an explicit
121// instantiation of the base class. From outside the vtkCommon
122// library we block this using an extern dllimport instantiation.
123// For classes inside vtkCommon we should be able to just do an
124// extern instantiation, but VS 2008 complains about missing
125// definitions. We cannot do an extern dllimport inside vtkCommon
126// since the symbols are local to the dll. An extern dllexport
127// seems to be the only way to convince VS 2008 to do the right
128// thing, so we just disable the warning.
129#pragma warning(disable : 4910) // extern and dllexport incompatible
130
131// Use an "extern explicit instantiation" to give the class a DLL
132// interface. This is a compiler-specific extension.
133VTK_ABI_NAMESPACE_BEGIN
135 extern template class VTKCOMMONCORE_EXPORT vtkImplicitArray, vtkStridedImplicitBackend);
136
137#pragma warning(pop)
138
139VTK_ABI_NAMESPACE_END
140#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 to give a strided view on a buffer.
#define vtkInstantiateSecondOrderTemplateMacro(decl0, decl1)
Definition vtkType.h:395
#define vtkExternSecondOrderTemplateMacro(decl0, decl1)
Definition vtkType.h:428