SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Types | Public Member Functions | List of all members
smtk::resource::Properties Class Referenceabstract

Resource/Component properties store data as maps from UUIDs to values and present data as key/value pairs on Resources/Components themselves. More...

#include <Properties.h>

Inheritance diagram for smtk::resource::Properties:
[legend]

Public Types

template<typename Type >
using Indexed = std::unordered_map< smtk::common::UUID, Type >
 

Public Member Functions

template<typename Type >
bool contains (const std::string &key) const
 Check whether a property associated with key is present.
 
template<typename Type >
bool insert (const std::string &key, const Type &value)
 Insert (key, value ) into the container.
 
template<typename Type >
bool emplace (const std::string &key, Type &&value)
 Emplace (key, value ) into the container.
 
template<typename Type >
void erase (const std::string &key)
 Erase property indexed by key from the container.
 
template<typename Type >
Type & at (const std::string &key)
 Access property indexed by key.
 
template<typename Type >
const Type & at (const std::string &key) const
 Access property indexed by key.
 
template<typename Type >
PropertiesOfType< Type > get ()
 Access properties of type Type.
 
template<typename Type >
const ConstPropertiesOfType< Type > get () const
 Access properties of type Type.
 

Detailed Description

Resource/Component properties store data as maps from UUIDs to values and present data as key/value pairs on Resources/Components themselves.

This misdirection is necessary to avoid the construction and storage of a map for each component in a resource. This virtual class provides a uniform API for both Resources and Components; it is subclassed for the respective class to utilize a single container per Resource.


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