VTK-m  1.5
Public Member Functions | Private Types | Private Member Functions | List of all members
vtkm::cont::VariantArrayHandleBase< TypeList > Class Template Reference

Holds an array handle without having to specify template parameters. More...

#include <ArrayCopy.h>

Public Member Functions

VTKM_CONT VariantArrayHandleBase ()=default
 
template<typename T , typename Storage >
VTKM_CONT VariantArrayHandleBase (const vtkm::cont::ArrayHandle< T, Storage > &array)
 
VTKM_CONT VariantArrayHandleBase (const VariantArrayHandleCommon &src)
 
VTKM_CONT VariantArrayHandleBase (const vtkm::cont::UnknownArrayHandle &src)
 
template<typename StorageList >
VTKM_CONT VariantArrayHandleBase (const vtkm::cont::UncertainArrayHandle< TypeList, StorageList > &src)
 
VTKM_CONT VariantArrayHandleBase (const VariantArrayHandleBase &)=default
 
VTKM_CONT VariantArrayHandleBase (VariantArrayHandleBase &&) noexcept=default
 
VTKM_CONT ~VariantArrayHandleBase ()
 
VTKM_CONT VariantArrayHandleBase< TypeList > & operator= (const VariantArrayHandleBase< TypeList > &)=default
 
VTKM_CONT VariantArrayHandleBase< TypeList > & operator= (VariantArrayHandleBase< TypeList > &&) noexcept=default
 
VTKM_CONT operator vtkm::cont::UncertainArrayHandle< TypeList, VTKM_DEFAULT_STORAGE_LIST > () const
 

Private Types

using Superclass = VariantArrayHandleCommon
 

Private Member Functions

 VTKM_STATIC_ASSERT_MSG ((!std::is_same< TypeList, vtkm::ListUniversal >::value), "Cannot use vtkm::ListUniversal with VariantArrayHandle.")
 

Detailed Description

template<typename TypeList>
class vtkm::cont::VariantArrayHandleBase< TypeList >

Holds an array handle without having to specify template parameters.

VariantArrayHandle holds an ArrayHandle object using runtime polymorphism to manage different value types and storage rather than compile-time templates. This adds a programming convenience that helps avoid a proliferation of templates. It also provides the management necessary to interface VTK-m with data sources where types will not be known until runtime.

To interface between the runtime polymorphism and the templated algorithms in VTK-m, VariantArrayHandle contains a method named CastAndCall that will determine the correct type from some known list of types. This mechanism is used internally by VTK-m's worklet invocation mechanism to determine the type when running algorithms.

By default, VariantArrayHandle will assume that the value type in the array matches one of the types specified by VTKM_DEFAULT_TYPE_LIST This list can be changed by using the ResetTypes. It is worthwhile to match these lists closely to the possible types that might be used. If a type is missing you will get a runtime error. If there are more types than necessary, then the template mechanism will create a lot of object code that is never used, and keep in mind that the number of combinations grows exponentially when using multiple VariantArrayHandle objects.

The actual implementation of VariantArrayHandle is in a templated class named VariantArrayHandleBase, which is templated on the list of component types.

Member Typedef Documentation

◆ Superclass

template<typename TypeList >
using vtkm::cont::VariantArrayHandleBase< TypeList >::Superclass = VariantArrayHandleCommon
private

Constructor & Destructor Documentation

◆ VariantArrayHandleBase() [1/7]

template<typename TypeList >
VTKM_CONT vtkm::cont::VariantArrayHandleBase< TypeList >::VariantArrayHandleBase ( )
default

◆ VariantArrayHandleBase() [2/7]

template<typename TypeList >
template<typename T , typename Storage >
VTKM_CONT vtkm::cont::VariantArrayHandleBase< TypeList >::VariantArrayHandleBase ( const vtkm::cont::ArrayHandle< T, Storage > &  array)
inline

◆ VariantArrayHandleBase() [3/7]

template<typename TypeList >
VTKM_CONT vtkm::cont::VariantArrayHandleBase< TypeList >::VariantArrayHandleBase ( const VariantArrayHandleCommon src)
inlineexplicit

◆ VariantArrayHandleBase() [4/7]

template<typename TypeList >
VTKM_CONT vtkm::cont::VariantArrayHandleBase< TypeList >::VariantArrayHandleBase ( const vtkm::cont::UnknownArrayHandle src)
inlineexplicit

◆ VariantArrayHandleBase() [5/7]

template<typename TypeList >
template<typename StorageList >
VTKM_CONT vtkm::cont::VariantArrayHandleBase< TypeList >::VariantArrayHandleBase ( const vtkm::cont::UncertainArrayHandle< TypeList, StorageList > &  src)
inline

◆ VariantArrayHandleBase() [6/7]

template<typename TypeList >
VTKM_CONT vtkm::cont::VariantArrayHandleBase< TypeList >::VariantArrayHandleBase ( const VariantArrayHandleBase< TypeList > &  )
default

◆ VariantArrayHandleBase() [7/7]

template<typename TypeList >
VTKM_CONT vtkm::cont::VariantArrayHandleBase< TypeList >::VariantArrayHandleBase ( VariantArrayHandleBase< TypeList > &&  )
defaultnoexcept

◆ ~VariantArrayHandleBase()

template<typename TypeList >
VTKM_CONT vtkm::cont::VariantArrayHandleBase< TypeList >::~VariantArrayHandleBase ( )
inline

Member Function Documentation

◆ operator vtkm::cont::UncertainArrayHandle< TypeList, VTKM_DEFAULT_STORAGE_LIST >()

template<typename TypeList >
VTKM_CONT vtkm::cont::VariantArrayHandleBase< TypeList >::operator vtkm::cont::UncertainArrayHandle< TypeList, VTKM_DEFAULT_STORAGE_LIST > ( ) const
inline

◆ operator=() [1/2]

template<typename TypeList >
VTKM_CONT VariantArrayHandleBase<TypeList>& vtkm::cont::VariantArrayHandleBase< TypeList >::operator= ( const VariantArrayHandleBase< TypeList > &  )
default

◆ operator=() [2/2]

template<typename TypeList >
VTKM_CONT VariantArrayHandleBase<TypeList>& vtkm::cont::VariantArrayHandleBase< TypeList >::operator= ( VariantArrayHandleBase< TypeList > &&  )
defaultnoexcept

◆ VTKM_STATIC_ASSERT_MSG()

template<typename TypeList >
vtkm::cont::VariantArrayHandleBase< TypeList >::VTKM_STATIC_ASSERT_MSG ( (!std::is_same< TypeList, vtkm::ListUniversal >::value)  ,
"Cannot use vtkm::ListUniversal with VariantArrayHandle."   
)
private

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