Stride Reference Manual
- generated for commit 9643b11
|
An std::array modified to enable subscripting with the constact pool type indentifiers. More...
#include <IdSubscriptArray.h>
Public Member Functions | |
IdSubscriptArray (T t) | |
What we 'll use most often and where we can have a default and initialize all array elements to the same value. More... | |
IdSubscriptArray () | |
IdSubscriptArray (std::initializer_list< T > l) | |
When we want to use an initializer list the elements is the (possibly emty) initializer list are applied to the first elements in order; any remaininig elements are default initialized. More... | |
IdSubscriptArray (std::array< T, NumOfTypes()> &&l) | |
Initialize with an array of the right dimensions. More... | |
std::array< T, NumOfTypes()>::reference | operator[] (ContactType::Id id) |
This actually works in itself but interferes annoyingly with the first constructor above and is for practical purpose redundant. More... | |
std::array< T, NumOfTypes()>::const_reference | operator[] (ContactType::Id id) const |
Subscripting with pool typ id as argument. More... | |
std::array< T, NumOfTypes()>::reference | at (ContactType::Id id) |
Subscripting with pool typ id as argument. More... | |
std::array< T, NumOfTypes()>::const_reference | at (ContactType::Id id) const |
Subscripting with pool typ id as argument. More... | |
An std::array modified to enable subscripting with the constact pool type indentifiers.
The bounds checking "at" method, to protevt against a subscript that is static_cast<Id> from an erroneous integer value.
We intentionally shadow the direct subscripting of the base array.
Writing constructor is somehat weird since std::array has no constructors, only aggregate initialization. But we want some constructors for shorthand expressions.
T | base type of the array. |
Definition at line 48 of file IdSubscriptArray.h.
|
inlineexplicit |
What we 'll use most often and where we can have a default and initialize all array elements to the same value.
e.g. IdSubscriptArray<unsigned int> m(1U);
Definition at line 54 of file IdSubscriptArray.h.
|
inlineexplicit |
Definition at line 61 of file IdSubscriptArray.h.
|
inline |
When we want to use an initializer list the elements is the (possibly emty) initializer list are applied to the first elements in order; any remaininig elements are default initialized.
e.g. IdSubscriptArray<unsigned int> mm {1U, 2U, 2U};
Definition at line 72 of file IdSubscriptArray.h.
|
inlineexplicit |
Initialize with an array of the right dimensions.
Makes sure nothing is default constructed Delegate it to the array move constructor Destructive...
Definition at line 89 of file IdSubscriptArray.h.
|
inline |
This actually works in itself but interferes annoyingly with the first constructor above and is for practical purpose redundant.
Forward constructor arguments to base class. template <typename... Args> explicit IdSubscriptArray(Args&&... args) : std::array<T, NumOfTypes()>{{std::forward<Args>(args)...}}{} Subscripting with pool typ id as argument.
Definition at line 99 of file IdSubscriptArray.h.
Referenced by stride::ContactType::IdSubscriptArray< AgeContactProfile >::IdSubscriptArray(), and stride::ContactType::IdSubscriptArray< bool >::IdSubscriptArray().
|
inline |
Subscripting with pool typ id as argument.
Definition at line 105 of file IdSubscriptArray.h.
|
inline |
Subscripting with pool typ id as argument.
Definition at line 111 of file IdSubscriptArray.h.
|
inline |
Subscripting with pool typ id as argument.
Definition at line 120 of file IdSubscriptArray.h.