|
CbmRoot
|
A subset of some enumeration entries and rule for mapping them to a contiguous integral index. More...
#include <CbmEnumKeySet.h>
Public Types | |
| using | Key_t = std::common_type_t<decltype(KeyList)...> |
| Type of the keys. | |
| using | Underlying_t = std::underlying_type_t<Key_t> |
| Underlying integral type of the enumerator. | |
| using | KeyContainer_t = std::array<Key_t, NofKeys()> |
Static Public Member Functions | |
| static constexpr bool | CheckKey (Key_t key) |
| Checks, if a key is provided within the Keys pack. | |
| template<Key_t Key> | |
| static constexpr size_t | Index () |
| Returns an index of the enumeration key, which is passed as a template parameter. | |
| static constexpr size_t | Index (Key_t key) |
| Returns an index of the enumeration key, which is passed as a parameter. | |
| static constexpr Underlying_t | MaxKey () |
| Returns maximal value of the keys. | |
| static constexpr Underlying_t | MinKey () |
| Returns minimal value of the keys. | |
| static constexpr size_t | NofKeys () |
| Returns number of keys. | |
| static constexpr size_t | MapperSize () |
| Returns size of the mapper. | |
Static Public Attributes | |
| static constexpr KeyContainer_t | kKeys = InitializedKeysArray() |
| A list of keys (for loops) | |
Private Types | |
| using | Container_t = std::array<size_t, MapperSize()> |
Static Private Member Functions | |
| static constexpr auto | InitializedKeysArray () |
| Returns initialized keys. | |
| static constexpr auto | InitializedMapper () |
| Returns the initialized mapper. | |
Static Private Attributes | |
| static constexpr Container_t | kMapper = InitializedMapper() |
| A mapping array of Enum_t -> index. | |
A subset of some enumeration entries and rule for mapping them to a contiguous integral index.
| KeyList... | A subset of enumeration entries |
Definition at line 26 of file CbmEnumKeySet.h.
|
private |
Definition at line 81 of file CbmEnumKeySet.h.
| using cbm::util::EnumKeySet< KeyList >::Key_t = std::common_type_t<decltype(KeyList)...> |
Type of the keys.
Definition at line 30 of file CbmEnumKeySet.h.
| using cbm::util::EnumKeySet< KeyList >::KeyContainer_t = std::array<Key_t, NofKeys()> |
Definition at line 78 of file CbmEnumKeySet.h.
| using cbm::util::EnumKeySet< KeyList >::Underlying_t = std::underlying_type_t<Key_t> |
Underlying integral type of the enumerator.
Definition at line 33 of file CbmEnumKeySet.h.
|
inlinestaticconstexpr |
Checks, if a key is provided within the Keys pack.
| key | A key to be tested |
Definition at line 39 of file CbmEnumKeySet.h.
|
inlinestaticconstexpr |
Returns an index of the enumeration key, which is passed as a template parameter.
| Key | A key |
Definition at line 44 of file CbmEnumKeySet.h.
Referenced by cbm::util::EnumKeySet< ESomeEnum::B, ESomeEnum::D, ESomeEnum::E >::Index().
|
inlinestaticconstexpr |
Returns an index of the enumeration key, which is passed as a parameter.
| key | A key |
Definition at line 53 of file CbmEnumKeySet.h.
|
inlinestaticconstexprprivate |
Returns initialized keys.
Definition at line 84 of file CbmEnumKeySet.h.
|
inlinestaticconstexprprivate |
Returns the initialized mapper.
Definition at line 93 of file CbmEnumKeySet.h.
|
inlinestaticconstexpr |
Returns size of the mapper.
Definition at line 76 of file CbmEnumKeySet.h.
|
inlinestaticconstexpr |
Returns maximal value of the keys.
Definition at line 59 of file CbmEnumKeySet.h.
Referenced by cbm::util::EnumKeySet< ESomeEnum::B, ESomeEnum::D, ESomeEnum::E >::MapperSize().
|
inlinestaticconstexpr |
Returns minimal value of the keys.
Definition at line 66 of file CbmEnumKeySet.h.
Referenced by cbm::util::EnumKeySet< ESomeEnum::B, ESomeEnum::D, ESomeEnum::E >::Index(), cbm::util::EnumKeySet< ESomeEnum::B, ESomeEnum::D, ESomeEnum::E >::InitializedMapper(), and cbm::util::EnumKeySet< ESomeEnum::B, ESomeEnum::D, ESomeEnum::E >::MapperSize().
|
inlinestaticconstexpr |
Returns number of keys.
Definition at line 73 of file CbmEnumKeySet.h.
|
staticconstexpr |
A list of keys (for loops)
Definition at line 110 of file CbmEnumKeySet.h.
|
staticconstexprprivate |
A mapping array of Enum_t -> index.
Definition at line 106 of file CbmEnumKeySet.h.