11 #ifndef smtk_resource_Links_h
12 #define smtk_resource_Links_h
14 #include "smtk/CoreExports.h"
16 #include "smtk/common/UUID.h"
25 struct LinkInformation;
34 typedef std::pair<smtk::common::UUID, smtk::common::UUID>
Key;
39 bool isLinkedTo(
const ResourcePtr&,
const RoleType&)
const;
40 bool isLinkedTo(
const ComponentPtr&,
const RoleType&)
const;
64 bool removeLink(
const Key&);
68 bool removeLinksTo(
const ResourcePtr&,
const RoleType&);
69 bool removeLinksTo(
const ComponentPtr&,
const RoleType&);
73 std::pair<PersistentObjectPtr, RoleType> linkedObjectAndRole(
const Key&)
const;
80 std::pair<smtk::common::UUID, RoleType> linkedObjectIdAndRole(
const Key&)
const;
83 return linkedObjectIdAndRole(key).first;
86 LinkInformation linkedObjectInformation(
const Key& key)
const;
89 virtual Resource* leftHandSideResource() = 0;
90 virtual const Resource* leftHandSideResource()
const = 0;
100 const RoleType& role)
const;
107 const RoleType& role);
110 linkedTo(
const Resource* lhs1,
const smtk::common::UUID& lhs2,
const RoleType& role)
const;
114 const Resource* rhs1,
116 const RoleType& role)
const;
119 linkedFrom(
const Resource* rhs1,
const smtk::common::UUID& rhs2,
const RoleType& role)
const;
121 bool removeLink(Resource* lhs1,
const Key& key);
128 const RoleType& role);
130 std::pair<PersistentObjectPtr, Links::RoleType> linkedObjectAndRole(
const Resource*,
const Key&)
133 std::pair<smtk::common::UUID, Links::RoleType> linkedObjectIdAndRole(
const Resource*,
const Key&)
136 LinkInformation linkedObjectInformation(
const Resource*,
const Key&)
const;
141 #endif // smtk_resource_Links_h