27 #include <initializer_list> 32 namespace ContactType {
114 throw std::out_of_range(
"IdSubscriptArray::at> Id out of range");
123 throw std::out_of_range(
"IdSubscriptArray::at> Id out of range");
180 throw std::out_of_range(
"IdSubscriptArray<bool>::at> Id out of range");
189 throw std::out_of_range(
"IdSubscriptArray::at> Id out of range");
IdSubscriptArray(std::initializer_list< T > l)
When we want to use an initializer list the elements is the (possibly emty) initializer list are appl...
Id
Enumerates the ContactPool types.
constexpr std::size_t ToSizeT(Id id)
Cast to size_t for indexing.
constexpr std::initializer_list< Id > IdList
To allow iteration over the type ids.
bool at(ContactType::Id id) const
Subscripting with pool typ id as argument.
bool operator[](ContactType::Id id) const
Subscripting with pool typ id as argument.
bitset< NumOfTypes()>::reference at(ContactType::Id id)
Subscripting with pool typ id as argument.
IdSubscriptArray(std::initializer_list< bool > l)
When we want to use an initializer list the elements is the (possibly emty) initializer list are appl...
constexpr unsigned int NumOfTypes()
Number of ContactPool types.
std::bitset< NumOfTypes()>::reference operator[](ContactType::Id id)
Subscripting with pool typ id as argument.
Definition of ContactPool Id Type.
std::array< T, NumOfTypes()>::const_reference operator[](ContactType::Id id) const
Subscripting with pool typ id as argument.
IdSubscriptArray(bool t=bool())
What we 'll use most often and where we can have a default and initialize all array elements to the s...
An std::array modified to enable subscripting with the constact pool type indentifiers.
IdSubscriptArray(std::array< T, NumOfTypes()> &&l)
Initialize with an array of the right dimensions.
std::array< T, NumOfTypes()>::const_reference at(ContactType::Id id) const
Subscripting with pool typ id as argument.
Namespace for the simulator and related classes.
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 p...
IdSubscriptArray(T t)
What we 'll use most often and where we can have a default and initialize all array elements to the s...
std::array< T, NumOfTypes()>::reference at(ContactType::Id id)
Subscripting with pool typ id as argument.