Go to the documentation of this file.
10 #ifndef vtk_m_cont_ArrayHandleOffsetsToNumComponents_h
11 #define vtk_m_cont_ArrayHandleOffsetsToNumComponents_h
22 template <
typename OffsetsPortal>
28 ArrayPortalOffsetsToNumComponents() =
default;
30 ArrayPortalOffsetsToNumComponents(
const OffsetsPortal& portal)
41 return static_cast<vtkm::IdComponent>(this->Portal.Get(index + 1) - this->Portal.Get(index));
53 template <
typename OffsetsStorageTag>
61 template <
typename OffsetsStorageTag>
65 using OffsetsStorage = vtkm::cont::internal::Storage<vtkm::Id, OffsetsStorageTag>;
71 using ReadPortalType =
72 vtkm::internal::ArrayPortalOffsetsToNumComponents<typename OffsetsStorage::ReadPortalType>;
74 VTKM_CONT static std::vector<vtkm::cont::internal::Buffer> CreateBuffers()
76 return OffsetsStorage::CreateBuffers();
80 const std::vector<vtkm::cont::internal::Buffer>&)
86 const std::vector<vtkm::cont::internal::Buffer>& buffers)
88 vtkm::Id numOffsets = OffsetsStorage::GetNumberOfValues(buffers);
92 "ArrayHandleOffsetsToNumComponents requires an offsets array with at least one value.");
94 return numOffsets - 1;
97 VTKM_CONT static ReadPortalType CreateReadPortal(
98 const std::vector<vtkm::cont::internal::Buffer>& buffers,
102 VTKM_ASSERT(OffsetsStorage::GetNumberOfValues(buffers) > 0);
103 return ReadPortalType(OffsetsStorage::CreateReadPortal(buffers, device, token));
134 template <
class OffsetsArray>
138 vtkm::cont::StorageTagOffsetsToNumComponents<typename OffsetsArray::StorageTag>>
142 "Offsets array must have a value type of vtkm::Id.");
158 template <
typename OffsetsStorageTag>
171 #endif //vtk_m_cont_ArrayHandleOffsetsToNumComponents_h
Manages an array-worth of data.
Definition: ArrayHandle.h:300
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
Definition: ArrayHandleOffsetsToNumComponents.h:54
#define VTKM_STORAGE_NO_RESIZE
Definition: Storage.h:185
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
#define VTKM_STORAGE_NO_WRITE_PORTAL
Definition: Storage.h:198
ArrayHandleOffsetsToNumComponents(const OffsetsArray &array)
Definition: ArrayHandleOffsetsToNumComponents.h:152
#define VTKM_IS_ARRAY_HANDLE(T)
Checks that the given type is a vtkm::cont::ArrayHandle.
Definition: ArrayHandle.h:137
#define VTKM_STATIC_ASSERT_MSG(condition, message)
Definition: StaticAssert.h:18
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
An object used to specify a device.
Definition: DeviceAdapterTag.h:58
This class is thrown when a VTKm function or method encounters an invalid value that inhibits progres...
Definition: ErrorBadValue.h:25
An ArrayHandle that converts an array of offsets to an array of Vec sizes.
Definition: ArrayHandleOffsetsToNumComponents.h:135
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:89
vtkm::cont::ArrayHandleOffsetsToNumComponents< vtkm::cont::ArrayHandle< vtkm::Id, OffsetsStorageTag > > make_ArrayHandleOffsetsToNumComponents(const vtkm::cont::ArrayHandle< vtkm::Id, OffsetsStorageTag > &array)
Definition: ArrayHandleOffsetsToNumComponents.h:161
typename vtkm::cont::detail::GetTypeInParentheses< void(vtkm::cont::ArrayHandle< vtkm::IdComponent, vtkm::cont::StorageTagOffsetsToNumComponents< typename OffsetsArray::StorageTag > >) >::type Superclass
Definition: ArrayHandleOffsetsToNumComponents.h:150