Go to the documentation of this file.
10 #ifndef vtk_m_cont_ArrayHandleDiscard_h
11 #define vtk_m_cont_ArrayHandleDiscard_h
17 #include <type_traits>
28 template <
typename ValueType_>
29 class ArrayPortalDiscard
32 using ValueType = ValueType_;
42 explicit ArrayPortalDiscard(
vtkm::Id numValues)
43 : NumberOfValues(numValues)
51 template <
class OtherV>
52 VTKM_CONT ArrayPortalDiscard(
const ArrayPortalDiscard<OtherV>& src)
53 : NumberOfValues(src.NumberOfValues)
58 vtkm::Id GetNumberOfValues()
const {
return this->NumberOfValues; }
67 void Set(
vtkm::Id index,
const ValueType&)
const
96 template <
typename ValueType>
97 class Storage<ValueType, StorageTagDiscard>
100 using WritePortalType = vtkm::exec::internal::ArrayPortalDiscard<ValueType>;
104 using ReadPortalType = vtkm::exec::internal::ArrayPortalDiscard<ValueType>;
106 VTKM_CONT static std::vector<vtkm::cont::internal::Buffer> CreateBuffers()
108 DiscardMetaData metaData;
109 metaData.NumberOfValues = 0;
110 return vtkm::cont::internal::CreateBuffers(metaData);
114 const std::vector<vtkm::cont::internal::Buffer>& buffers,
119 buffers[0].GetMetaData<DiscardMetaData>().NumberOfValues = numValues;
123 const std::vector<vtkm::cont::internal::Buffer>&)
129 const std::vector<vtkm::cont::internal::Buffer>& buffers)
131 return buffers[0].GetMetaData<DiscardMetaData>().NumberOfValues;
134 VTKM_CONT static void Fill(
const std::vector<vtkm::cont::internal::Buffer>&,
143 VTKM_CONT static ReadPortalType CreateReadPortal(
const std::vector<vtkm::cont::internal::Buffer>&,
150 VTKM_CONT static WritePortalType CreateWritePortal(
151 const std::vector<vtkm::cont::internal::Buffer>& buffers,
155 return WritePortalType(GetNumberOfValues(buffers));
159 template <
typename ValueType_>
160 struct ArrayHandleDiscardTraits
162 using ValueType = ValueType_;
163 using StorageTag = StorageTagDiscard;
172 template <
typename ValueType_>
182 template <
typename T>
187 template <
typename T>
195 #endif // vtk_m_cont_ArrayHandleDiscard_h
Manages an array-worth of data.
Definition: ArrayHandle.h:300
#define VTKM_EXEC
Definition: ExportMacros.h:51
Groups connected points that have the same field value.
Definition: Atomic.h:19
auto Get(const vtkm::Tuple< Ts... > &tuple)
Retrieve the object from a vtkm::Tuple at the given index.
Definition: Tuple.h:81
#define VTKM_ARRAY_HANDLE_SUBCLASS(classname, fullclasstype, superclass)
Macro to make default methods in ArrayHandle subclasses.
Definition: ArrayHandle.h:243
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
ArrayHandleDiscard is a write-only array that discards all data written to it.
Definition: ArrayHandleDiscard.h:173
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
typename vtkm::cont::detail::GetTypeInParentheses< void(typename internal::ArrayHandleDiscardTraits< ValueType_ >::Superclass) >::type Superclass
Definition: ArrayHandleDiscard.h:178
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
Treat a Vec or Vec-like object as a flat Vec.
Definition: VecFlat.h:224
An object used to specify a device.
Definition: DeviceAdapterTag.h:58
#define VTKM_UNREACHABLE(msg)
VTKM_UNREACHABLE is similar to VTK_ASSUME, with the significant difference that it is not conditional...
Definition: Unreachable.h:31
Helper to determine if an ArrayHandle type is an ArrayHandleDiscard.
Definition: ArrayHandleDiscard.h:183
This class is thrown when a VTKm function or method encounters an invalid value that inhibits progres...
Definition: ErrorBadValue.h:25
CopyFlag
Identifier used to specify whether a function should deep copy data.
Definition: Flags.h:17
static T ZeroInitialization()
A static function that returns 0 (or the closest equivalent to it) for the given type.
Definition: TypeTraits.h:77
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:89
#define VTKM_SUPPRESS_EXEC_WARNINGS
Definition: ExportMacros.h:53