VTK-m
2.0
|
An ArrayHandle that can behave like several other handles. More...
#include <ArrayHandleMultiplexer.h>
Public Member Functions | |
VTKM_ARRAY_HANDLE_SUBCLASS (ArrayHandleMultiplexer,(ArrayHandleMultiplexer< ArrayHandleTypes... >),(vtkm::cont::ArrayHandle< typename Traits::ValueType, typename Traits::StorageTag >)) | |
template<typename RealStorageTag > | |
VTKM_CONT | ArrayHandleMultiplexer (const vtkm::cont::ArrayHandle< ValueType, RealStorageTag > &src) |
VTKM_CONT bool | IsValid () const |
template<typename S > | |
VTKM_CONT void | SetArray (const vtkm::cont::ArrayHandle< ValueType, S > &src) |
VTKM_CONT auto | GetArrayHandleVariant () const -> decltype(StorageType::GetArrayHandleVariant(this->GetBuffers())) |
Private Types | |
using | Traits = detail::ArrayHandleMultiplexerTraits< ArrayHandleTypes... > |
using | StorageType = vtkm::cont::internal::Storage< ValueType, StorageTag > |
An ArrayHandle that can behave like several other handles.
An ArrayHandleMultiplexer
simply redirects its calls to another ArrayHandle
. However the type of that ArrayHandle
does not need to be (completely) known at runtime. Rather, ArrayHandleMultiplexer
is defined over a set of possible ArrayHandle
types. Any one of these ArrayHandles
may be assigned to the ArrayHandleMultiplexer
.
When a value is retreived from the ArrayHandleMultiplexer
, the multiplexer checks to see which type of array is currently stored in it. It then redirects to the ArrayHandle
of the appropriate type.
The ArrayHandleMultiplexer
template parameters are all the ArrayHandle types it should support.
If only one template parameter is given, it is assumed to be the ValueType
of the array. A default list of supported arrays is supported (see vtkm::cont::internal::ArrayHandleMultiplexerDefaultArrays
.) If multiple template parameters are given, they are all considered possible ArrayHandle
types.
|
private |
|
private |
|
inline |
|
inline |
|
inline |
|
inline |
vtkm::cont::ArrayHandleMultiplexer< ArrayHandleTypes >::VTKM_ARRAY_HANDLE_SUBCLASS | ( | ArrayHandleMultiplexer< ArrayHandleTypes > | , |
(ArrayHandleMultiplexer< ArrayHandleTypes... >) | , | ||
(vtkm::cont::ArrayHandle< typename Traits::ValueType, typename Traits::StorageTag >) | |||
) |