CVB++ 15.0
ConstRefValue< T, K > Class Template Referencefinal

This class holds references to K values of type T. More...

#include <cvb/block.hpp>

Public Member Functions

template<class... TT>
 ConstRefValue (const TT &... refs)
 Constructor from reference values. More...
 
template<class Ty >
Ty Cast () const noexcept
 Cast to any type, for which a set<size_t>(Ty) function exists. More...
 
X () const noexcept
 Get const value of the first (x) value. More...
 
template<size_t N = K, std::enable_if_t< less< 1, N >::value, int > = 0>
Y () const noexcept
 Get const value of the second (y) value. More...
 
template<size_t N = K, std::enable_if_t< less< 2, N >::value, int > = 0>
Z () const noexcept
 Get const value of the third (z) value. More...
 
template<size_t N = K, std::enable_if_t< less< 3, N >::value, int > = 0>
W () const noexcept
 Get const value of the fourth (w) value. More...
 
operator[] (size_t i) const noexcept
 Element access. More...
 

Static Public Member Functions

static constexpr size_t NumValues () noexcept
 Get number of values stored in this ConstRefValue. More...
 

Related Functions

(Note that these are not member functions.)

template<size_t I, class T , size_t K, std::enable_if_t< less< I, K >::value, int > = 0>
auto get (const ConstRefValue< T, K > &refVal) noexcept -> decltype(refVal[I])
 Get's the I-th element of the ConstRefValue<T,K>. More...
 
template<size_t I, class Ty , size_t K>
CVB_FORCE_INLINE void internal_set (ConstRefValue< Ty, K > &refVal, const Ty *val) noexcept
 

Detailed Description

template<class T, size_t K>
class Cvb::ConstRefValue< T, K >

This class holds references to K values of type T.

See also
Block, Visit

Constructor & Destructor Documentation

◆ ConstRefValue()

ConstRefValue ( const TT &...  refs)
inlineexplicit

Constructor from reference values.

Parameters
[in]refsK references to values that are stored in the order of the parameters.

Member Function Documentation

◆ Cast()

Ty Cast ( ) const
inlinenoexcept

Cast to any type, for which a set<size_t>(Ty) function exists.

Template Parameters
TyTarget type, for which a Cvb::set<size_t>(Ty) function exists.
Returns
A newly constructed object of Ty.

◆ NumValues()

static constexpr size_t NumValues ( )
inlinestaticconstexprnoexcept

Get number of values stored in this ConstRefValue.

Returns
size_t The number of values K.

◆ operator[]()

T operator[] ( size_t  i) const
inlinenoexcept

Element access.

Parameters
[in]iThe index of the requested element.
Returns
T The value of the i-th element.

◆ W()

T W ( ) const
inlinenoexcept

Get const value of the fourth (w) value.

Returns
The w value.

◆ X()

T X ( ) const
inlinenoexcept

Get const value of the first (x) value.

Returns
The x value.

◆ Y()

T Y ( ) const
inlinenoexcept

Get const value of the second (y) value.

Returns
The y value.

◆ Z()

T Z ( ) const
inlinenoexcept

Get const value of the third (z) value.

Returns
The z value.

Friends And Related Function Documentation

◆ get()

auto get ( const ConstRefValue< T, K > &  refVal) -> decltype(refVal[I])
related

Get's the I-th element of the ConstRefValue<T,K>.

See also
Block, Visit
Precondition
I < K
Template Parameters
IThe index of the element.
Parameters
refValThe ConstRefValue<T,K> to retrieve the I-th element from.
Returns
The I-th element of refVal.

◆ internal_set()

CVB_FORCE_INLINE void internal_set ( ConstRefValue< Ty, K > &  refVal,
const Ty *  val 
)
related

Set's the I-th pointer in the ConstRefValue<T,K> refVal.

See also
Block, Visit
Precondition
I < K
Template Parameters
IThe index of the pointer to set.
Parameters
refValThe ConstRefValue<T,K> to set the I-th pointer in.
valThe pointer to be set as the I-th element of refVal.