FleCSI User API Version: 2.3.0
 
Loading...
Searching...
No Matches
dimensioned_array< TYPE, DIMENSION, NAMESPACE > Class Template Reference

The dimensioned_array type provides a general base for defining contiguous array types that have a specific dimension. More...

Public Member Functions

template<typename... ARGS, typename = std::enable_if_t<sizeof...(ARGS) == DIMENSION && convertible_type<TYPE, ARGS...>::value>>
constexpr dimensioned_array (ARGS... args)
 Variadic constructor.
 
constexpr dimensioned_array (std::initializer_list< TYPE > list)
 Initializer list constructor.
 
constexpr dimensioned_array (TYPE const &val)
 Constructor (fill with given value).
 
constexpr dimensioned_array operator/ (TYPE val)
 Division operator involving a constant.
 
constexpr dimensioned_arrayoperator= (const TYPE &val)
 Assignment operator.
 
template<typename ENUM_TYPE >
constexpr TYPE & operator[] (ENUM_TYPE e)
 Support for enumerated type access, e.g., da[x], for accessing the x axis.
 
template<typename ENUM_TYPE >
constexpr TYPE const & operator[] (ENUM_TYPE e) const
 Support for enumerated type access, e.g., da[x], for accessing the x axis.
 

Static Public Member Functions

static constexpr Dimension size ()
 Return the size of the array.
 

Detailed Description

template<typename TYPE, Dimension DIMENSION, std::size_t NAMESPACE>
class flecsi::util::dimensioned_array< TYPE, DIMENSION, NAMESPACE >

The dimensioned_array type provides a general base for defining contiguous array types that have a specific dimension.

Template Parameters
TYPEThe type of the array, e.g., P.O.D. type.
DIMENSIONThe dimension of the array, i.e., the number of elements to be stored in the array.
NAMESPACEThe namespace of the array. This is a dummy parameter that is useful for creating distinct types that alias dimensioned_array.

Constructor & Destructor Documentation

◆ dimensioned_array() [1/3]

template<typename TYPE , Dimension DIMENSION, std::size_t NAMESPACE>
constexpr dimensioned_array ( std::initializer_list< TYPE >  list)
constexpr

Initializer list constructor.

◆ dimensioned_array() [2/3]

template<typename TYPE , Dimension DIMENSION, std::size_t NAMESPACE>
template<typename... ARGS, typename = std::enable_if_t<sizeof...(ARGS) == DIMENSION && convertible_type<TYPE, ARGS...>::value>>
constexpr dimensioned_array ( ARGS...  args)
constexpr

Variadic constructor.

◆ dimensioned_array() [3/3]

template<typename TYPE , Dimension DIMENSION, std::size_t NAMESPACE>
constexpr dimensioned_array ( TYPE const &  val)
constexpr

Constructor (fill with given value).

Member Function Documentation

◆ size()

template<typename TYPE , Dimension DIMENSION, std::size_t NAMESPACE>
static constexpr Dimension size ( )
staticconstexpr

Return the size of the array.

◆ operator[]() [1/2]

template<typename TYPE , Dimension DIMENSION, std::size_t NAMESPACE>
template<typename ENUM_TYPE >
constexpr TYPE & operator[] ( ENUM_TYPE  e)
constexpr

Support for enumerated type access, e.g., da[x], for accessing the x axis.

◆ operator[]() [2/2]

template<typename TYPE , Dimension DIMENSION, std::size_t NAMESPACE>
template<typename ENUM_TYPE >
constexpr TYPE const & operator[] ( ENUM_TYPE  e) const
constexpr

Support for enumerated type access, e.g., da[x], for accessing the x axis.

◆ operator=()

template<typename TYPE , Dimension DIMENSION, std::size_t NAMESPACE>
constexpr dimensioned_array & operator= ( const TYPE &  val)
constexpr

Assignment operator.

◆ operator/()

template<typename TYPE , Dimension DIMENSION, std::size_t NAMESPACE>
constexpr dimensioned_array operator/ ( TYPE  val)
constexpr

Division operator involving a constant.

Parameters
[in]valThe constant on the right hand side of the operator.
Returns
A reference to the current object.