SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Classes | Public Member Functions | Friends | List of all members
smtk::resource::detail::PropertiesOfType< std::unordered_map< smtk::common::UUID, Type > > Class Template Reference

A specialization of the smtk::common::PropertiesContainer for a single type. More...

#include <Properties.h>

Inheritance diagram for smtk::resource::detail::PropertiesOfType< std::unordered_map< smtk::common::UUID, Type > >:
[legend]
Collaboration diagram for smtk::resource::detail::PropertiesOfType< std::unordered_map< smtk::common::UUID, Type > >:
[legend]

Public Member Functions

std::size_t eraseId (const smtk::common::UUID &id) override
 Erase all properties held by this object which correspond to the given uid. More...
 
bool isCopyable () const override
 Return true if properties of this type may be copy-constructed.
 
std::size_t copyFrom (PropertiesBase *otherBase, smtk::string::Token propertyName, const smtk::common::UUID &otherId, const smtk::common::UUID &uid) override
 Copy the property or properties held by other which correspond to otherId into this object under the given uid. More...
 
void allNames (std::unordered_set< smtk::string::Token > &names) const override
 Insert (into names) all of the property names that exist in this object.
 
void allIds (std::set< smtk::common::UUID > &ids) const override
 Insert (into ids) all of the UUIDs that properties held by this object reference.
 
void idsWithProperty (smtk::string::Token &propName, std::set< smtk::common::UUID > &ids) const override
 Insert (into ids) all of the UUIDs for which propName is defined.
 
- Public Member Functions inherited from smtk::common::TypeMapEntry< std::string, std::unordered_map< smtk::common::UUID, Type > >
 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 std::string &key) const
 Check whether a value associated with key is present.
 
bool insert (const std::string &key, const std::unordered_map< smtk::common::UUID, Type > &value)
 Insert (key, value ) into the map.
 
bool emplace (const std::string &key, std::unordered_map< smtk::common::UUID, Type > &&value)
 Emplace (key, value ) into the map.
 
void erase (const std::string &key)
 Erase value indexed by key from the map.
 
std::unordered_map< smtk::common::UUID, Type > & operator[] (const std::string &key)
 Access value indexed by key.
 
std::unordered_map< smtk::common::UUID, Type > & at (const std::string &key)
 Access value indexed by key.
 
const std::unordered_map< smtk::common::UUID, Type > & at (const std::string &key) const
 Access value indexed by key.
 
std::unordered_map< std::string, std::unordered_map< smtk::common::UUID, Type > > & data ()
 Access the class's underlying data.
 
const std::unordered_map< std::string, std::unordered_map< smtk::common::UUID, 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
 
- Public Member Functions inherited from smtk::common::TypeMapEntryBase
virtual std::size_t size () const
 

Friends

class Properties
 

Additional Inherited Members

- Public Types inherited from smtk::common::TypeMapEntry< std::string, std::unordered_map< smtk::common::UUID, Type > >
typedef std::string key_type
 
typedef std::unordered_map< smtk::common::UUID, Type > mapped_type
 
- Protected Member Functions inherited from smtk::common::TypeMapEntry< std::string, std::unordered_map< smtk::common::UUID, Type > >
 TypeMapEntry ()=default
 Construction of this class is delegated to TypeMap.
 

Detailed Description

template<typename Type>
class smtk::resource::detail::PropertiesOfType< std::unordered_map< smtk::common::UUID, Type > >

A specialization of the smtk::common::PropertiesContainer for a single type.

PropertiesOfType provides a non-templated API for accessing property information, as well as logic for erasing properties associated with a UUID (needed for cleaning up after components are deleted).

Member Function Documentation

◆ copyFrom()

template<typename Type >
std::size_t smtk::resource::detail::PropertiesOfType< std::unordered_map< smtk::common::UUID, Type > >::copyFrom ( PropertiesBase other,
smtk::string::Token  propertyName,
const smtk::common::UUID otherId,
const smtk::common::UUID uid 
)
inlineoverridevirtual

Copy the property or properties held by other which correspond to otherId into this object under the given uid.

If propertyName is invalid, then all properties are copied. Otherwise, just the named property is copied (assuming it exists in other).

The number of entries copied is returned.

Implements smtk::resource::detail::PropertiesBase.

◆ eraseId()

template<typename Type >
std::size_t smtk::resource::detail::PropertiesOfType< std::unordered_map< smtk::common::UUID, Type > >::eraseId ( const smtk::common::UUID uid)
inlineoverridevirtual

Erase all properties held by this object which correspond to the given uid.

The number of entries removed is returned.

Implements smtk::resource::detail::PropertiesBase.


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