VTK-m  2.0
Public Member Functions | Private Types | List of all members
vtkm::cont::ArrayHandleMultiplexer< ArrayHandleTypes > Class Template Reference

An ArrayHandle that can behave like several other handles. More...

#include <ArrayHandleMultiplexer.h>

Inheritance diagram for vtkm::cont::ArrayHandleMultiplexer< ArrayHandleTypes >:
vtkm::cont::ArrayHandle< detail::ArrayHandleMultiplexerTraits< ArrayHandleTypes... >::ValueType, detail::ArrayHandleMultiplexerTraits< ArrayHandleTypes... >::StorageTag >

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 >
 

Detailed Description

template<typename... ArrayHandleTypes>
class vtkm::cont::ArrayHandleMultiplexer< ArrayHandleTypes >

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.

Member Typedef Documentation

◆ StorageType

template<typename... ArrayHandleTypes>
using vtkm::cont::ArrayHandleMultiplexer< ArrayHandleTypes >::StorageType = vtkm::cont::internal::Storage<ValueType, StorageTag>
private

◆ Traits

template<typename... ArrayHandleTypes>
using vtkm::cont::ArrayHandleMultiplexer< ArrayHandleTypes >::Traits = detail::ArrayHandleMultiplexerTraits<ArrayHandleTypes...>
private

Constructor & Destructor Documentation

◆ ArrayHandleMultiplexer()

template<typename... ArrayHandleTypes>
template<typename RealStorageTag >
VTKM_CONT vtkm::cont::ArrayHandleMultiplexer< ArrayHandleTypes >::ArrayHandleMultiplexer ( const vtkm::cont::ArrayHandle< ValueType, RealStorageTag > &  src)
inline

Member Function Documentation

◆ GetArrayHandleVariant()

template<typename... ArrayHandleTypes>
VTKM_CONT auto vtkm::cont::ArrayHandleMultiplexer< ArrayHandleTypes >::GetArrayHandleVariant ( ) const -> decltype(StorageType::GetArrayHandleVariant(this->GetBuffers()))
inline

◆ IsValid()

template<typename... ArrayHandleTypes>
VTKM_CONT bool vtkm::cont::ArrayHandleMultiplexer< ArrayHandleTypes >::IsValid ( ) const
inline

◆ SetArray()

template<typename... ArrayHandleTypes>
template<typename S >
VTKM_CONT void vtkm::cont::ArrayHandleMultiplexer< ArrayHandleTypes >::SetArray ( const vtkm::cont::ArrayHandle< ValueType, S > &  src)
inline

◆ VTKM_ARRAY_HANDLE_SUBCLASS()

template<typename... ArrayHandleTypes>
vtkm::cont::ArrayHandleMultiplexer< ArrayHandleTypes >::VTKM_ARRAY_HANDLE_SUBCLASS ( ArrayHandleMultiplexer< ArrayHandleTypes >  ,
(ArrayHandleMultiplexer< ArrayHandleTypes... >)  ,
(vtkm::cont::ArrayHandle< typename Traits::ValueType, typename Traits::StorageTag >)   
)

The documentation for this class was generated from the following file: