SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
The ResourceLinks class is a resource-specific API for manipulating unidirectional links from a Resource and its Components to other Resources and Components. More...
#include <ResourceLinks.h>
Public Types | |
typedef smtk::common::Links< smtk::common::UUID, smtk::common::UUID, smtk::common::UUID, int, ResourceLinkBase > | ResourceLinkData |
typedef ResourceLinkData::Link | Link |
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 |
Public Member Functions | |
ResourceLinkData & | data () |
Access the underlying link data. | |
const ResourceLinkData & | data () const |
bool | resolve (const ResourcePtr &) const |
Resolve any surrogates with the given resource. More... | |
bool | removeAllLinksTo (const ResourcePtr &) |
Remove all links from this resource to another resource. More... | |
Public Member Functions inherited from smtk::resource::Links | |
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 |
Friends | |
class | smtk::resource::Resource |
Additional Inherited Members | |
Protected Member Functions inherited from smtk::resource::Links | |
virtual const smtk::common::UUID & | leftHandSideComponentId () const |
The ResourceLinks class is a resource-specific API for manipulating unidirectional links from a Resource and its Components to other Resources and Components.
Internally, the storage structure for links is an smtk::common::Links instance describing links between resources, and each link in this structure is an smtk::common::Links instance describing links between components.
bool smtk::resource::detail::ResourceLinks::removeAllLinksTo | ( | const ResourcePtr & | resource | ) |
Remove all links from this resource to another resource.
This is useful when we know the resource parameter is being permanently deleted.
bool smtk::resource::detail::ResourceLinks::resolve | ( | const ResourcePtr & | resource | ) | const |
Resolve any surrogates with the given resource.
Returns true if a surrogate is successfully resolved.