SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
A specialization of the TypeMapBase for a single type. More...
#include <TypeMap.h>
Public Types | |
typedef KeyType | key_type |
typedef Type | mapped_type |
Public Member Functions | |
TypeMapEntry (const TypeMapEntry &)=delete | |
As an extension of TypeMapBase's API, copy & move construction are not supported. | |
TypeMapEntry (TypeMapEntry &&)=delete | |
TypeMapEntry & | operator= (const TypeMapEntry &)=delete |
TypeMapEntry & | operator= (TypeMapEntry &&)=delete |
bool | contains (const KeyType &key) const |
Check whether a value associated with key is present. | |
bool | insert (const KeyType &key, const Type &value) |
Insert (key, value ) into the map. | |
bool | emplace (const KeyType &key, Type &&value) |
Emplace (key, value ) into the map. | |
void | erase (const KeyType &key) |
Erase value indexed by key from the map. | |
Type & | operator[] (const KeyType &key) |
Access value indexed by key. | |
Type & | at (const KeyType &key) |
Access value indexed by key. | |
const Type & | at (const KeyType &key) const |
Access value indexed by key. | |
std::unordered_map< KeyType, Type > & | data () |
Access the class's underlying data. | |
const std::unordered_map< KeyType, Type > & | data () const |
std::size_t | size () const override |
void | clear () override |
void | to_json (nlohmann::json &j) const override |
void | from_json (const nlohmann::json &j) override |
Protected Member Functions | |
TypeMapEntry ()=default | |
Construction of this class is delegated to TypeMap. | |
Friends | |
class | TypeMap< KeyType > |
A specialization of the TypeMapBase for a single type.
TypeMapEntry provides a non-templated API for accessing information, as well as serialization logic if the underlying type is serializable.