SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
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>
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. | |
virtual std::size_t | clear ()=0 |
Remove all properties this object manages. | |
Protected Member Functions | |
template<typename PropertyTypeTuple > | |
std::size_t | clearInternal (const smtk::common::UUID &uid) |
This is a method subclasses may call from their implementation of clear() in order to iterate over all acceptable property types and remove a UUID from the map. | |
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.