SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
The TypeMapBase class holds the storage and API for TypeMap. More...
#include <TypeMap.h>
Public Member Functions | |
template<typename Type > | |
bool | contains (const KeyType &key) const |
Check whether a value of type Type associated with key is present. More... | |
template<typename Type > | |
bool | insert (const KeyType &key, const Type &value) |
Insert (Type, key, value ) into the map. | |
template<typename Type > | |
bool | emplace (const KeyType &key, Type &&value) |
Emplace (Type, key, value ) into the map. | |
template<typename Type > | |
void | erase (const KeyType &key) |
Erase value of type Type indexed by key from the map. | |
template<typename Type > | |
Type & | at (const KeyType &key) |
Access value of type Type indexed by key. More... | |
template<typename Type > | |
const Type & | at (const KeyType &key) const |
Access value of type Type indexed by key. More... | |
template<typename Type > | |
TypeMapEntry< KeyType, Type > & | get () |
Access values of type Type. | |
template<typename Type > | |
const TypeMapEntry< KeyType, Type > & | get () const |
Access values of type Type. | |
template<typename Type > | |
bool | containsType () const |
Check whether type Type is supported. | |
std::unordered_map< std::string, TypeMapEntryBase * > & | data () |
Access the class's underlying data. | |
const std::unordered_map< std::string, TypeMapEntryBase * > & | data () const |
The TypeMapBase class holds the storage and API for TypeMap.
It is decoupled from TypeMap to facilitate reuse by downstream classes that can derive from TypeMapEntry<>. TypeMapBase does not contain any methods to insert types (this functionality is delegated to the downstream TypeMap class).
|
inline |
Access value of type Type indexed by key.
On average, this method has constant complexity and can therefore be used in conjunction with contains() for conditional queries.
|
inline |
Access value of type Type indexed by key.
On average, this method has constant complexity and can therefore be used in conjunction with contains() for conditional queries.
|
inline |
Check whether a value of type Type associated with key is present.
On average, this method has constant complexity and can therefore be used in conjunction with at() for conditional queries.