SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
Container for all the namespaces a resource presents for components to share. More...
#include <DomainMap.h>
Public Member Functions | |
DomainMap (const DomainMap &)=default | |
DomainMap & | operator= (const DomainMap &)=default |
bool | contains (const smtk::string::Token &space) const |
Return true if the space exists in this map. | |
bool | insert (const smtk::string::Token &space, const std::shared_ptr< Domain > &domain) |
Insert the domain instance into the map, returning true on success (and failure if space already existed). | |
std::shared_ptr< Domain > | find (const smtk::string::Token &space) const |
Find a domain for the given namespace, returning null if none exists. | |
std::shared_ptr< Domain > | operator[] (const smtk::string::Token &space) const |
Find a domain for the given namespace, returning null if none exists. | |
template<typename DomainType > | |
std::shared_ptr< DomainType > | findAs (const smtk::string::Token &space) const |
A convenience to downcast a domain to the type expected for space. | |
template<typename DomainType , typename... Args> | |
bool | create (const smtk::string::Token &space, Args &&... args) |
Create a domain of the given DomainType and insert it into the map at space. | |
std::unordered_set< smtk::string::Token > | keys () const |
Return a set of all the domain "names" in the map. | |
Protected Attributes | |
std::unordered_map< smtk::string::Token, std::shared_ptr< Domain > > | m_domains |
Container for all the namespaces a resource presents for components to share.
Components may own their own private domains, but if multiple components are intended to share a domain, the resource should own and manage it via this map.