SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
The ComponentLinks class is a component-specific API for manipulating unidirectional links from a component to other Resources and Components. More...
#include <ComponentLinks.h>
Public Types | |
typedef smtk::common::Links< smtk::common::UUID, smtk::common::UUID, smtk::common::UUID, int, ComponentLinkBase > | Data |
Public Types inherited from smtk::resource::Links | |
typedef std::pair< smtk::common::UUID, smtk::common::UUID > | Key |
A Key is a pair of UUIDs. More... | |
typedef int | RoleType |
Friends | |
class | smtk::resource::Component |
Additional Inherited Members | |
Public Member Functions inherited from smtk::resource::Links | |
virtual | ~Links ()=default |
Force this class to be polymorphic. | |
bool | isLinkedTo (const ResourcePtr &, const RoleType &) const |
Given a resource or component and a role, check if a link of this role type exists between us and the input object. | |
bool | isLinkedTo (const ComponentPtr &, const RoleType &) const |
Key | addLinkTo (const ResourcePtr &, const RoleType &) |
Given a resource or component and a role type, construct a link from us to the input object and assign the link a random UUID. More... | |
Key | addLinkTo (const ComponentPtr &, const RoleType &) |
PersistentObjectSet | linkedTo (const RoleType &) const |
Given a role, return a set of objects to which this object links. | |
PersistentObjectSet | linkedFrom (const ResourcePtr &, const RoleType &) const |
Given a role and a resource corresponding to the rhs of a link, return a set of objects from the rhs that link to this object using this role type. | |
PersistentObjectSet | linkedFrom (const RoleType &) const |
Given a role, return a set of objects that link to this object using this role type. More... | |
bool | removeLink (const Key &) |
Given a Link key, remove the associated link. Return true if successful. | |
bool | removeLinksTo (const ResourcePtr &, const RoleType &) |
Given a resource or component and a role, remove all links from this object and the input object of this role type. More... | |
bool | removeLinksTo (const ComponentPtr &, const RoleType &) |
std::pair< PersistentObjectPtr, RoleType > | linkedObjectAndRole (const Key &) const |
Given a Link key, return the object and role to which this object is linked, or return nullptr if no link exists with this link id. | |
PersistentObjectPtr | linkedObject (const Key &key) const |
std::pair< smtk::common::UUID, RoleType > | linkedObjectIdAndRole (const Key &) const |
Given a Link key, return the id and role to which this object is linked, or return a null id if no link exists with this link id. More... | |
smtk::common::UUID | linkedObjectId (const Key &key) const |
LinkInformation | linkedObjectInformation (const Key &key) const |
Static Public Member Functions inherited from smtk::resource::Links | |
static constexpr RoleType | topLevelRole () |
static constexpr RoleType | invalidRole () |
Static Public Attributes inherited from smtk::resource::Links | |
static constexpr RoleType | TopLevelRole = std::numeric_limits<Links::RoleType>::lowest() |
A special role used to link pairs of resources together. More... | |
static constexpr RoleType | InvalidRole = std::numeric_limits<Links::RoleType>::lowest() + 1 |
A special Role indicating that a link is invalid. | |
Protected Member Functions inherited from smtk::resource::Links | |
Key | addLinkTo (Resource *lhs1, const smtk::common::UUID &lhs2, const ResourcePtr &rhs1, const smtk::common::UUID &rhs2, const RoleType &role) |
This is protected so that ResourceLinks::copyLinks() can call it. More... | |
The ComponentLinks class is a component-specific API for manipulating unidirectional links from a component to other Resources and Components.
Internally, the class is stateless; all calls are performed through the component's resource.