VTK  9.3.0
vtkConstantImplicitBackend.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 vtkConstantImplicitBackend_h
5#define vtkConstantImplicitBackend_h
6
7#include "vtkCommonCoreModule.h"
8#include "vtkSetGet.h" // for vtkNotUsed
9
31VTK_ABI_NAMESPACE_BEGIN
32template <typename ValueType>
33struct VTKCOMMONCORE_EXPORT vtkConstantImplicitBackend final
34{
41 : Value(val)
42 {
43 }
44
50 ValueType operator()(int vtkNotUsed(index)) const { return this->Value; }
51
55 const ValueType Value;
56};
57VTK_ABI_NAMESPACE_END
58
59#endif // vtkConstantImplicitBackend_h
60
61#ifdef VTK_CONSTANT_BACKEND_INSTANTIATING
62#define VTK_INSTANTIATE_CONSTANT_BACKEND(ValueType) \
63 VTK_ABI_NAMESPACE_BEGIN \
64 template struct VTKCOMMONCORE_EXPORT vtkConstantImplicitBackend<ValueType>; \
65 VTK_ABI_NAMESPACE_END
66#endif
A utility structure serving as a backend for constant implicit arrays.
ValueType operator()(int vtkNotUsed(index)) const
The main call method for the backend.
vtkConstantImplicitBackend(ValueType val)
A non-trivially contructible constructor.
const ValueType Value
The constant value stored in the backend.