VTK  9.4.20250114
vtkCompositeImplicitBackend.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 vtkCompositeImplicitBackend_h
5#define vtkCompositeImplicitBackend_h
6
41#include "vtkCommonCoreModule.h"
42#include "vtkCompiler.h" // For VTK_USE_EXTERN_TEMPLATE
43#include "vtkType.h" // For vtkExternTemplateMacro
44
45#include <memory>
46#include <vector>
47
48VTK_ABI_NAMESPACE_BEGIN
49class vtkDataArray;
51template <typename ValueType>
52class VTKCOMMONCORE_EXPORT vtkCompositeImplicitBackend final
53{
54public:
60 vtkCompositeImplicitBackend(const std::vector<vtkDataArray*>& arrays);
63
71 ValueType operator()(vtkIdType idx) const;
72
78 unsigned long getMemorySize() const;
79
80protected:
81 struct Internals;
82 std::unique_ptr<Internals> Internal;
83};
84VTK_ABI_NAMESPACE_END
85
86#endif // vtkCompositeImplicitBackend_h
87
88#if defined(VTK_COMPOSITE_BACKEND_INSTANTIATING)
89
90#define VTK_INSTANTIATE_COMPOSITE_BACKEND(ValueType) \
91 VTK_ABI_NAMESPACE_BEGIN \
92 template class VTKCOMMONCORE_EXPORT vtkCompositeImplicitBackend<ValueType>; \
93 VTK_ABI_NAMESPACE_END
94
95#elif defined(VTK_USE_EXTERN_TEMPLATE)
96
97#ifndef VTK_COMPOSITE_BACKEND_TEMPLATE_EXTERN
98#define VTK_COMPOSITE_BACKEND_TEMPLATE_EXTERN
99#ifdef _MSC_VER
100#pragma warning(push)
101#pragma warning(disable : 4910) // extern and dllexport incompatible
102#endif
103VTK_ABI_NAMESPACE_BEGIN
104vtkExternTemplateMacro(extern template class VTKCOMMONCORE_EXPORT vtkCompositeImplicitBackend);
105VTK_ABI_NAMESPACE_END
106#ifdef _MSC_VER
107#pragma warning(pop)
108#endif
109#endif // VTK_COMPOSITE_IMPLICIT_BACKEND_TEMPLATE_EXTERN
110
111#endif
A utility structure serving as a backend for composite arrays: an array composed of multiple arrays c...
ValueType operator()(vtkIdType idx) const
Indexing operator for the composite of the two arrays respecting the vtkImplicitArray expectations.
vtkCompositeImplicitBackend(const std::vector< vtkDataArray * > &arrays)
Constructor for the backend.
std::unique_ptr< Internals > Internal
unsigned long getMemorySize() const
Returns the smallest integer memory size in KiB needed to store the array.
vtkCompositeImplicitBackend(vtkDataArrayCollection *arrays)
maintain an ordered list of dataarray objects
abstract superclass for arrays of numeric data
#define vtkExternTemplateMacro(decl)
A macro to declare extern templates for all numerical types.
Definition vtkType.h:410
int vtkIdType
Definition vtkType.h:315