Go to the documentation of this file.
10 #ifndef vtk_m_cont_ArrayHandleConstant_h
11 #define vtk_m_cont_ArrayHandleConstant_h
27 template <
typename ValueType>
31 ConstantFunctor(
const ValueType& value = ValueType())
44 using StorageTagConstantSuperclass =
48 struct Storage<T,
vtkm::cont::StorageTagConstant> : Storage<T, StorageTagConstantSuperclass<T>>
72 : Superclass(internal::FunctorToArrayHandleImplicitBuffers(internal::ConstantFunctor<T>(value),
104 template <
typename T>
105 struct SerializableTypeString<
vtkm::cont::ArrayHandleConstant<T>>
114 template <
typename T>
115 struct SerializableTypeString<
vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagConstant>>
116 : SerializableTypeString<vtkm::cont::ArrayHandleConstant<T>>
125 template <
typename T>
126 struct Serialization<
vtkm::cont::ArrayHandleConstant<T>>
133 static VTKM_CONT void save(BinaryBuffer& bb,
const BaseType& obj)
135 vtkmdiy::save(bb, obj.GetNumberOfValues());
136 vtkmdiy::save(bb, obj.ReadPortal().Get(0));
151 template <
typename T>
152 struct Serialization<
vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagConstant>>
153 : Serialization<vtkm::cont::ArrayHandleConstant<T>>
160 #endif //vtk_m_cont_ArrayHandleConstant_h
VTKM_ARRAY_HANDLE_SUBCLASS(ArrayHandleConstant,(ArrayHandleConstant< T >),(vtkm::cont::ArrayHandle< T, vtkm::cont::StorageTagConstant >))
VTKM_CONT ArrayHandleConstant(T value, vtkm::Id numberOfValues=0)
Definition: ArrayHandleConstant.h:71
Manages an array-worth of data.
Definition: ArrayHandle.h:283
Groups connected points that have the same field value.
Definition: Atomic.h:19
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC_CONT auto Get(const vtkm::Tuple< Ts... > &tuple) -> decltype(tuple.template Get< Index >())
Retrieve the object from a vtkm::Tuple at the given index.
Definition: Tuple.h:83
VTKM_CONT T GetValue() const
Returns the constant value stored in this array.
Definition: ArrayHandleConstant.h:81
vtkm::cont::ArrayHandleConstant< T > make_ArrayHandleConstant(T value, vtkm::Id numberOfValues)
make_ArrayHandleConstant is convenience function to generate an ArrayHandleImplicit.
Definition: ArrayHandleConstant.h:89
Definition: Particle.h:331
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC T load(const U &u, vtkm::Id v)
Definition: FetchTagArrayDirectIn.h:36
Definition: ArrayHandleConstant.h:20
#define VTKM_CONT
Definition: ExportMacros.h:57
An array handle with a constant value.
Definition: ArrayHandleConstant.h:63
#define vtkmNotUsed(parameter_name)
Simple macro to identify a parameter as unused.
Definition: ExportMacros.h:128
VTKM_CONT ReadPortalType ReadPortal() const
Get an array portal that can be used in the control environment.
Definition: ArrayHandle.h:414
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:92
An ArrayHandle that computes values on the fly.
Definition: ArrayHandleImplicit.h:174