VTK-m  2.2
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

constexpr VecC ()
 
constexpr VecC (T *array, vtkm::IdComponent size)
 
template<vtkm::IdComponent Size>
constexpr VecC (vtkm::Vec< T, Size > &src)
 
constexpr VecC (T &src)
 
constexpr VecC (const VecC< T > &src)
 
constexpr const T & operator[] (vtkm::IdComponent index) const
 
constexpr T & operator[] (vtkm::IdComponent index)
 
constexpr 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 >
constexpr vtkm::VecC< T >::VecC ( )
inlineconstexpr

◆ VecC() [2/5]

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

◆ VecC() [3/5]

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

◆ VecC() [4/5]

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

◆ VecC() [5/5]

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

Member Function Documentation

◆ GetNumberOfComponents()

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

◆ operator=()

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

◆ operator[]() [1/2]

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

◆ operator[]() [2/2]

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

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: