CbmRoot
Loading...
Searching...
No Matches
cbm::core::EnumArray< E, T > Class Template Reference

#include <CbmEnumArray.h>

Inheritance diagram for cbm::core::EnumArray< E, T >:
[legend]
Collaboration diagram for cbm::core::EnumArray< E, T >:
[legend]

Public Member Functions

T & operator[] (const E &entry)
 Mutable access operator, indexed by enum entry.
 
T & operator[] (U index)
 Mutable access operator, indexed by underlying index type.
 
const T & operator[] (const E &entry) const
 Constant access operator, indexed by enum entry.
 
const T & operator[] (U index) const
 Constant access operator, indexed by underlying index type.
 
 operator Arr & () const
 Convertion operator to the base array class.
 

Private Types

using U = typename std::underlying_type<E>::type
 Underlying type of enumeration.
 
using Arr = std::array<T, static_cast<std::size_t>(E::END)>
 

Private Member Functions

template<typename Archive >
void serialize (Archive &ar, const unsigned int)
 

Friends

class boost::serialization::access
 

Detailed Description

template<class E, class T>
class cbm::core::EnumArray< E, T >

Definition at line 26 of file CbmEnumArray.h.

Member Typedef Documentation

◆ Arr

template<class E , class T >
using cbm::core::EnumArray< E, T >::Arr = std::array<T, static_cast<std::size_t>(E::END)>
private

Definition at line 28 of file CbmEnumArray.h.

◆ U

template<class E , class T >
using cbm::core::EnumArray< E, T >::U = typename std::underlying_type<E>::type
private

Underlying type of enumeration.

Definition at line 27 of file CbmEnumArray.h.

Member Function Documentation

◆ operator Arr &()

template<class E , class T >
cbm::core::EnumArray< E, T >::operator Arr & ( ) const
inline

Convertion operator to the base array class.

Definition at line 48 of file CbmEnumArray.h.

◆ operator[]() [1/4]

template<class E , class T >
T & cbm::core::EnumArray< E, T >::operator[] ( const E & entry)
inline

Mutable access operator, indexed by enum entry.

Parameters
entryEnum entry for the element

Definition at line 33 of file CbmEnumArray.h.

◆ operator[]() [2/4]

template<class E , class T >
const T & cbm::core::EnumArray< E, T >::operator[] ( const E & entry) const
inline

Constant access operator, indexed by enum entry.

Parameters
entryEnum entry for the element

Definition at line 41 of file CbmEnumArray.h.

◆ operator[]() [3/4]

template<class E , class T >
T & cbm::core::EnumArray< E, T >::operator[] ( U index)
inline

Mutable access operator, indexed by underlying index type.

Parameters
indexIndex of the element

Definition at line 37 of file CbmEnumArray.h.

◆ operator[]() [4/4]

template<class E , class T >
const T & cbm::core::EnumArray< E, T >::operator[] ( U index) const
inline

Constant access operator, indexed by underlying index type.

Parameters
indexIndex of the element

Definition at line 45 of file CbmEnumArray.h.

◆ serialize()

template<class E , class T >
template<typename Archive >
void cbm::core::EnumArray< E, T >::serialize ( Archive & ar,
const unsigned int  )
inlineprivate

Definition at line 53 of file CbmEnumArray.h.

Friends And Related Symbol Documentation

◆ boost::serialization::access

template<class E , class T >
friend class boost::serialization::access
friend

Definition at line 51 of file CbmEnumArray.h.


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