VTK  9.5.20251117
vtkStdFunctionArray.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 vtkStdFunctionArray_h
5#define vtkStdFunctionArray_h
6
7#ifdef VTK_STD_FUNCTION_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
15#ifdef VTK_STD_FUNCTION_ARRAY_INSTANTIATING
16#undef VTK_IMPLICIT_VALUERANGE_INSTANTIATING
17#endif
18
19#include <functional>
20
37VTK_ABI_NAMESPACE_BEGIN
38template <typename T>
41VTK_ABI_NAMESPACE_END
42
43#endif // vtkStdFunctionArray_h
44
45#ifdef VTK_STD_FUNCTION_ARRAY_INSTANTIATING
46
47#define VTK_INSTANTIATE_STD_FUNCTION_ARRAY(ValueType) \
48 VTK_ABI_NAMESPACE_BEGIN \
49 template class VTKCOMMONCORE_EXPORT \
50 vtkImplicitArray<std::function<ValueType(int)>, vtkArrayTypes::VTK_STD_FUNCTION_ARRAY>; \
51 VTK_ABI_NAMESPACE_END \
52 namespace vtkDataArrayPrivate \
53 { \
54 VTK_ABI_NAMESPACE_BEGIN \
55 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE( \
56 VTK_WRAP_TEMPLATE( \
57 vtkImplicitArray<std::function<ValueType(int)>, vtkArrayTypes::VTK_STD_FUNCTION_ARRAY>), \
58 double) \
59 VTK_ABI_NAMESPACE_END \
60 }
61#elif defined(VTK_USE_EXTERN_TEMPLATE)
62#ifndef VTK_STD_FUNCTION_ARRAY_TEMPLATE_EXTERN
63#define VTK_STD_FUNCTION_ARRAY_TEMPLATE_EXTERN
64#ifdef _MSC_VER
65#pragma warning(push)
66// The following is needed when the vtkAffineArray is declared
67// dllexport and is used from another class in vtkCommonCore
68#pragma warning(disable : 4910) // extern and dllexport incompatible
69#endif
70VTK_ABI_NAMESPACE_BEGIN
72 extern template class VTKCOMMONCORE_EXPORT vtkImplicitArray, std::function, int,
74#ifdef _MSC_VER
75#pragma warning(pop)
76#endif
77VTK_ABI_NAMESPACE_END
78#endif // VTK_STD_FUNCTION_ARRAY_TEMPLATE_EXTERN
79// The following clause is only for MSVC 2008 and 2010
80#elif defined(_MSC_VER) && !defined(VTK_BUILD_SHARED_LIBS)
81#pragma warning(push)
82// C4091: 'extern ' : ignored on left of 'int' when no variable is declared
83#pragma warning(disable : 4091)
84
85// Compiler-specific extension warning.
86#pragma warning(disable : 4231)
87
88// We need to disable warning 4910 and do an extern dllexport
89// anyway. When deriving new arrays from an
90// instantiation of this template the compiler does an explicit
91// instantiation of the base class. From outside the vtkCommon
92// library we block this using an extern dllimport instantiation.
93// For classes inside vtkCommon we should be able to just do an
94// extern instantiation, but VS 2008 complains about missing
95// definitions. We cannot do an extern dllimport inside vtkCommon
96// since the symbols are local to the dll. An extern dllexport
97// seems to be the only way to convince VS 2008 to do the right
98// thing, so we just disable the warning.
99#pragma warning(disable : 4910) // extern and dllexport incompatible
100
101// Use an "extern explicit instantiation" to give the class a DLL
102// interface. This is a compiler-specific extension.
103VTK_ABI_NAMESPACE_BEGIN
105 extern template class VTKCOMMONCORE_EXPORT vtkImplicitArray, std::function, int,
107
108#pragma warning(pop)
109
110VTK_ABI_NAMESPACE_END
111#endif
A read only array class that wraps an implicit function from integers to any value type supported by ...
#define vtkInstantiateStdFunctionWithParameterTemplateMacro(decl0, decl1, delc2, par)
Definition vtkType.h:475
@ VTK_STD_FUNCTION_ARRAY
Definition vtkType.h:95
#define vtkExternStdFunctionWithParameterTemplateMacro(decl0, decl1, decl2, par)
Definition vtkType.h:499