SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Member Functions | List of all members
smtk::common::TypeMapBase< KeyType > Class Template Referenceabstract

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
 

Detailed Description

template<typename KeyType>
class smtk::common::TypeMapBase< KeyType >

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).

Member Function Documentation

◆ at() [1/2]

template<typename KeyType >
template<typename Type >
Type& smtk::common::TypeMapBase< KeyType >::at ( const KeyType &  key)
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.

◆ at() [2/2]

template<typename KeyType >
template<typename Type >
const Type& smtk::common::TypeMapBase< KeyType >::at ( const KeyType &  key) const
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.

◆ contains()

template<typename KeyType >
template<typename Type >
bool smtk::common::TypeMapBase< KeyType >::contains ( const KeyType &  key) const
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.


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