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

An abstract base class for SMTK resources and their components. More...

#include <PersistentObject.h>

Inheritance diagram for smtk::resource::PersistentObject:
[legend]
Collaboration diagram for smtk::resource::PersistentObject:
[legend]

Public Member Functions

 smtkTypeMacroBase (smtk::resource::PersistentObject)
 
virtual const common::UUIDid () 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::Linkslinks ()=0
 
virtual const smtk::resource::Linkslinks () const =0
 
virtual smtk::resource::Propertiesproperties ()=0
 
virtual const smtk::resource::Propertiesproperties () const =0
 

Detailed Description

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.

Member Function Documentation

◆ setId()

virtual bool smtk::resource::PersistentObject::setId ( const common::UUID myID)
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.


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