SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
smtk::common::TypeMapEntry< KeyType, Type > Class Template Reference

A specialization of the TypeMapBase for a single type. More...

#include <TypeMap.h>

Inheritance diagram for smtk::common::TypeMapEntry< KeyType, Type >:
[legend]
Collaboration diagram for smtk::common::TypeMapEntry< KeyType, Type >:
[legend]

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
 
TypeMapEntryoperator= (const TypeMapEntry &)=delete
 
TypeMapEntryoperator= (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 >
 

Detailed Description

template<typename KeyType, typename Type>
class smtk::common::TypeMapEntry< KeyType, Type >

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.


The documentation for this class was generated from the following file: