SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
An abstract base class for SMTK resources and their components. More...
#include <PersistentObject.h>
Public Member Functions | |
smtkTypeMacroBase (smtk::resource::PersistentObject) | |
virtual const common::UUID & | id () const =0 |
Return a unique identifier for the object which will be persistent across sessions. | |
virtual bool | setId (const common::UUID &myID)=0 |
Assign an ID to this object (used by readers; not for arbitrary reuse). More... | |
virtual std::string | name () const |
Return the name of the object - by default it will return the UUID but that can be overridden. | |
template<typename T > | |
T::Ptr | as () |
Attempt to cast this object to a subclass. | |
template<typename T > | |
T::ConstPtr | as () const |
Attempt to cast this object to a subclass. | |
virtual smtk::resource::Links & | links ()=0 |
virtual const smtk::resource::Links & | links () const =0 |
virtual smtk::resource::Properties & | properties ()=0 |
virtual const smtk::resource::Properties & | properties () const =0 |
An abstract base class for SMTK resources and their components.
Both resources and their components are intended to be accessed via the resource system as black boxes using UUIDs. They are exposed similarly in user interfaces (e.g., a tree view of SMTK state usually includes both resources and their children), so it is useful to be able to refer to either type interchangeably. Hence, this class exists so that user interfaces can hold onto resources and components without knowing or caring about their type.
|
pure virtual |
Assign an ID to this object (used by readers; not for arbitrary reuse).
TODO: care must be taken to modify the recorded ID in all links that connect to this object (see Resource::setId and its treatment of manager registration for reference).
Implemented in smtk::graph::Component, smtk::resource::Resource, smtk::mesh::Component, smtk::attribute::Attribute, and smtk::model::Entity.