VTK-m  2.1
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
vtkm::VecC< T > Class Template Reference

A Vec-like representation for short arrays. More...

#include <Types.h>

Public Types

using ComponentType = T
 

Public Member Functions

 VecC ()
 
 VecC (T *array, vtkm::IdComponent size)
 
template<vtkm::IdComponent Size>
 VecC (vtkm::Vec< T, Size > &src)
 
 VecC (T &src)
 
 VecC (const VecC< T > &src)
 
const T & operator[] (vtkm::IdComponent index) const
 
T & operator[] (vtkm::IdComponent index)
 
vtkm::IdComponent GetNumberOfComponents () const
 
VecC< T > & operator= (const VecC< T > &src)
 

Private Types

using Superclass = detail::VecCBase< T, VecC< T > >
 

Private Attributes

T *const Components
 
vtkm::IdComponent NumberOfComponents
 

Detailed Description

template<typename T>
class vtkm::VecC< T >

A Vec-like representation for short arrays.

The VecC class takes a short array of values and provides an interface that mimics Vec. This provides a mechanism to treat C arrays like a Vec. It is useful in situations where you want to use a Vec but the data must come from elsewhere or in certain situations where the size cannot be determined at compile time. In particular, Vec objects of different sizes can potentially all be converted to a VecC of the same type.

Note that VecC holds a reference to an outside array given to it. If that array gets destroyed (for example because the source goes out of scope), the behavior becomes undefined.

You cannot use VecC with a const type in its template argument. For example, you cannot declare VecC<const vtkm::Id>. If you want a non-mutable VecC, the VecCConst class (e.g. VecCConst<vtkm::Id>).

Member Typedef Documentation

◆ ComponentType

template<typename T >
using vtkm::VecC< T >::ComponentType = T

◆ Superclass

template<typename T >
using vtkm::VecC< T >::Superclass = detail::VecCBase<T, VecC<T> >
private

Constructor & Destructor Documentation

◆ VecC() [1/5]

template<typename T >
vtkm::VecC< T >::VecC ( )
inline

◆ VecC() [2/5]

template<typename T >
vtkm::VecC< T >::VecC ( T *  array,
vtkm::IdComponent  size 
)
inline

◆ VecC() [3/5]

template<typename T >
template<vtkm::IdComponent Size>
vtkm::VecC< T >::VecC ( vtkm::Vec< T, Size > &  src)
inline

◆ VecC() [4/5]

template<typename T >
vtkm::VecC< T >::VecC ( T &  src)
inlineexplicit

◆ VecC() [5/5]

template<typename T >
vtkm::VecC< T >::VecC ( const VecC< T > &  src)
inline

Member Function Documentation

◆ GetNumberOfComponents()

template<typename T >
vtkm::IdComponent vtkm::VecC< T >::GetNumberOfComponents ( ) const
inline

◆ operator=()

template<typename T >
VecC<T>& vtkm::VecC< T >::operator= ( const VecC< T > &  src)
inline

◆ operator[]() [1/2]

template<typename T >
T& vtkm::VecC< T >::operator[] ( vtkm::IdComponent  index)
inline

◆ operator[]() [2/2]

template<typename T >
const T& vtkm::VecC< T >::operator[] ( vtkm::IdComponent  index) const
inline

Member Data Documentation

◆ Components

template<typename T >
T* const vtkm::VecC< T >::Components
private

◆ NumberOfComponents

template<typename T >
vtkm::IdComponent vtkm::VecC< T >::NumberOfComponents
private

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