SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
11 #ifndef smtk_resource_Component_h
12 #define smtk_resource_Component_h
14 #include "smtk/resource/ComponentLinks.h"
15 #include "smtk/resource/PersistentObject.h"
16 #include "smtk/resource/Properties.h"
48 typedef std::function<void(
const ComponentPtr&)> Visitor;
75 template<
typename ResourceType>
78 return dynamic_cast<ResourceType*
>(this->parentResource());
83 const Links& links()
const override {
return m_links; }
87 const Properties& properties()
const override {
return m_properties; }
94 Properties m_properties;
99 #endif // smtk_resource_Component_h
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
Properties & properties() override
Return properties defined on this component.
Definition: Component.h:86
Links is a virtual class describing the API for connecting one resource/component to another resource...
Definition: Links.h:29
Links & links() override
Return the links that connect this component to external resources/components.
Definition: Component.h:82
The ComponentLinks class is a component-specific API for manipulating unidirectional links from a com...
Definition: ComponentLinks.h:40
#define smtkSharedFromThisMacro(...)
A macro to help with derived classes whose bases enable shared_from_this().
Definition: SharedFromThis.h:250
#define smtkTypeMacro(...)
Add typedefs to a class for identifcation.
Definition: SharedFromThis.h:128
This specialization of smtk::resource::Properties completes aforementioned class's implementation by ...
Definition: Properties.h:770
#define smtkSuperclassMacro(...)
Add a typedef to the superclass of this class.
Definition: SharedFromThis.h:147
An abstract base class for SMTK resources.
Definition: Resource.h:72
ResourceType * parentResourceAs() const
This variant of parentResource casts the result to the given ResourceType.
Definition: Component.h:76
Resource/Component properties store data as maps from UUIDs to values and present data as key/value p...
Definition: Properties.h:504
Component is the base class for records stored in an smtk::resource::Resource.
Definition: Component.h:43
An abstract base class for SMTK resources and their components.
Definition: PersistentObject.h:39
smtk::shared_ptr< smtk::resource::Component > ComponentPtr
Definition: PublicPointerDefs.h:304
virtual Resource * parentResource() const
Return a raw (not shared) pointer to the resource that owns this component.
Definition: Component.h:72
smtk::shared_ptr< smtk::resource::Resource > ResourcePtr
Definition: PublicPointerDefs.h:302