Viskores  1.0
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
viskores::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, viskores::IdComponent size)
 
template<viskores::IdComponent Size>
constexpr VecC (viskores::Vec< T, Size > &src)
 
constexpr VecC (T &src)
 
constexpr VecC (const VecC< T > &src)
 
constexpr const T & operator[] (viskores::IdComponent index) const
 
constexpr T & operator[] (viskores::IdComponent index)
 
constexpr viskores::IdComponent GetNumberOfComponents () const
 
VecC< T > & operator= (const VecC< T > &src)
 

Private Types

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

Private Attributes

T *const Components
 
viskores::IdComponent NumberOfComponents
 

Detailed Description

template<typename T>
class viskores::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 viskores::Id>. If you want a non-mutable VecC, the VecCConst class (e.g. VecCConst<viskores::Id>).

Member Typedef Documentation

◆ ComponentType

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

◆ Superclass

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

Constructor & Destructor Documentation

◆ VecC() [1/5]

template<typename T >
constexpr viskores::VecC< T >::VecC ( )
inlineconstexpr

◆ VecC() [2/5]

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

◆ VecC() [3/5]

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

◆ VecC() [4/5]

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

◆ VecC() [5/5]

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

Member Function Documentation

◆ GetNumberOfComponents()

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

◆ operator=()

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

◆ operator[]() [1/2]

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

◆ operator[]() [2/2]

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

Member Data Documentation

◆ Components

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

◆ NumberOfComponents

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

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