VTK-m  2.0
Public Member Functions | Private Types | Private Member Functions | List of all members
vtkm::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType > Class Template Reference

Implicitly transform values of one array to another with a functor. More...

#include <ArrayHandleTransform.h>

Inheritance diagram for vtkm::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >:
vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >

Public Member Functions

 VTKM_ARRAY_HANDLE_SUBCLASS (ArrayHandleTransform,(ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >),(vtkm::cont::ArrayHandle< typename internal::StorageTagTransform< ArrayHandleType, FunctorType, InverseFunctorType >::ValueType, internal::StorageTagTransform< ArrayHandleType, FunctorType, InverseFunctorType >>))
 
 ArrayHandleTransform (const ArrayHandleType &handle, const FunctorType &functor=FunctorType(), const InverseFunctorType &inverseFunctor=InverseFunctorType())
 
 ~ArrayHandleTransform ()
 Implemented so that it is defined exclusively in the control environment. More...
 
ArrayHandleType GetTransformedArray () const
 Returns the ArrayHandle that is being transformed. More...
 
FunctorType GetFunctor () const
 Returns the functor transforming the ArrayHandle. More...
 
InverseFunctorType GetInverseFunctor () const
 Returns the inverse functor transforming the ArrayHandle More...
 

Private Types

using StorageType = vtkm::cont::internal::Storage< ValueType, StorageTag >
 

Private Member Functions

 VTKM_IS_ARRAY_HANDLE (ArrayHandleType)
 

Detailed Description

template<typename ArrayHandleType, typename FunctorType, typename InverseFunctorType>
class vtkm::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >

Implicitly transform values of one array to another with a functor.

ArrayHandleTransforms is a specialization of ArrayHandle. It takes a delegate array handle and makes a new handle that calls a given unary functor with the element at a given index and returns the result of the functor as the value of this array at that position. This transformation is done on demand. That is, rather than make a new copy of the array with new values, the transformation is done as values are read from the array. Thus, the functor operator should work in both the control and execution environments.

Member Typedef Documentation

◆ StorageType

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
using vtkm::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::StorageType = vtkm::cont::internal::Storage<ValueType, StorageTag>
private

Constructor & Destructor Documentation

◆ ArrayHandleTransform()

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
vtkm::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::ArrayHandleTransform ( const ArrayHandleType &  handle,
const FunctorType &  functor = FunctorType(),
const InverseFunctorType &  inverseFunctor = InverseFunctorType() 
)
inline

◆ ~ArrayHandleTransform()

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
vtkm::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::~ArrayHandleTransform ( )
inline

Implemented so that it is defined exclusively in the control environment.

If there is a separate device for the execution environment (for example, with CUDA), then the automatically generated destructor could be created for all devices, and it would not be valid for all devices.

Member Function Documentation

◆ GetFunctor()

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
FunctorType vtkm::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::GetFunctor ( ) const
inline

Returns the functor transforming the ArrayHandle.

◆ GetInverseFunctor()

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
InverseFunctorType vtkm::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::GetInverseFunctor ( ) const
inline

Returns the inverse functor transforming the ArrayHandle

◆ GetTransformedArray()

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
ArrayHandleType vtkm::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::GetTransformedArray ( ) const
inline

Returns the ArrayHandle that is being transformed.

◆ VTKM_ARRAY_HANDLE_SUBCLASS()

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
vtkm::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::VTKM_ARRAY_HANDLE_SUBCLASS ( ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >  ,
(ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >)  ,
(vtkm::cont::ArrayHandle< typename internal::StorageTagTransform< ArrayHandleType, FunctorType, InverseFunctorType >::ValueType, internal::StorageTagTransform< ArrayHandleType, FunctorType, InverseFunctorType >>)   
)

◆ VTKM_IS_ARRAY_HANDLE()

template<typename ArrayHandleType , typename FunctorType , typename InverseFunctorType >
vtkm::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >::VTKM_IS_ARRAY_HANDLE ( ArrayHandleType  )
private

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