SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
11 #ifndef smtk_graph_ArcImplementation_h
12 #define smtk_graph_ArcImplementation_h
17 #include "smtk/graph/detail/TypeTraits.h"
19 #include "smtk/graph/RuntimeArcEndpoint.h"
23 #include "smtk/graph/ArcImplementationBase.h"
24 #include "smtk/resource/Component.h"
25 #include "smtk/string/Token.h"
32 template<Directionality>
36 template<
typename TraitsType>
38 template<
typename TraitsType,
typename Const,
typename Outgoing>
47 template<
typename ArcTraits>
51 using Traits = ArcTraits;
64 using ToType =
typename ArcTraits::ToType;
79 static constexpr std::size_t MinOutDegree = minOutDegree<ArcTraits>(
unconstrained());
81 static constexpr std::size_t MinInDegree = minInDegree<ArcTraits>(
unconstrained());
83 static constexpr std::size_t MaxOutDegree = maxOutDegree<ArcTraits>(
unconstrained());
85 static constexpr std::size_t MaxInDegree = maxInDegree<ArcTraits>(
unconstrained());
87 Directed::value || !std::is_same<FromType, ToType>::value ||
88 (MaxOutDegree == MaxInDegree && MinOutDegree == MinInDegree),
90 Undirected arcs with identical From/To types must
91 have identical in- and out-degree constraints.)");
106 std::string
typeName()
const override {
return smtk::common::typeName<ArcTraits>(); }
110 return this->isDirected() ? Directionality::IsDirected : Directionality::IsUndirected;
112 bool mutability()
const override {
return this->isMutable(); }
116 typename U =
typename ArcProperties<ArcTraits>::template hasFromNodeSpecs<ArcTraits>::type>
117 typename std::enable_if<!U::value, std::unordered_set<smtk::string::Token>>::type _fromTypes()
120 return { { (
"'" + smtk::common::typeName<typename ArcTraits::FromType>() +
"'") } };
124 typename U =
typename ArcProperties<ArcTraits>::template hasFromNodeSpecs<ArcTraits>::type>
125 typename std::enable_if<U::value, std::unordered_set<smtk::string::Token>>::type _fromTypes()
128 return m_data.traits().m_fromNodeSpecs;
131 template<typename U = typename ArcProperties<ArcTraits>::template hasToNodeSpecs<ArcTraits>::type>
132 typename std::enable_if<!U::value, std::unordered_set<smtk::string::Token>>::type _toTypes()
const
134 return { { (
"'" + smtk::common::typeName<typename ArcTraits::ToType>() +
"'") } };
137 template<typename U = typename ArcProperties<ArcTraits>::template hasToNodeSpecs<ArcTraits>::type>
138 typename std::enable_if<U::value, std::unordered_set<smtk::string::Token>>::type _toTypes()
const
140 return m_data.traits().m_toNodeSpecs;
144 std::unordered_set<smtk::string::Token> fromTypes()
const override {
return this->_fromTypes(); }
146 std::unordered_set<smtk::string::Token> toTypes()
const override {
return this->_toTypes(); }
166 typename std::enable_if<U::value, bool>::type
empty()
const
168 auto result = m_data.size();
175 typename std::enable_if<!U::value, bool>::type
empty()
const
188 template<
typename TraitsType>
196 return self->inVisitor(node, [&](
const FromType* from) {
return visitor(from); });
200 template<
typename TraitsType>
218 const auto* properType =
dynamic_cast<const FromType*
>(from);
229 [
this](
bool isMax) {
return isMax ? maximumOutDegree() : minimumOutDegree(); },
231 [
this, properType]() {
return this->outDegree(properType); },
233 [
this, properType](
const Component* to) {
234 if (
const auto* properTo =
dynamic_cast<const ToType*
>(to))
236 return this->contains(properType, properTo);
243 [
this, properType](
const Component*) {
return false; },
246 return this->outVisitor(properType, [&](
const ToType* node) {
return visitor(node); });
252 const auto* properType =
dynamic_cast<const FromType*
>(from);
263 [
this](
bool isMax) {
return isMax ? maximumOutDegree() : minimumOutDegree(); },
265 [
this, properType]() {
return this->outDegree(properType); },
267 [
this, properType](
const Component* to) {
268 if (
const auto* properTo =
dynamic_cast<const ToType*
>(to))
270 return this->contains(properType, properTo);
278 (beforeTo && !
dynamic_cast<const ToType*
>(beforeTo)) ||
279 (beforeFrom && !
dynamic_cast<const FromType*
>(beforeFrom)))
284 if (
const auto* properTo =
dynamic_cast<const ToType*
>(to))
290 dynamic_cast<const FromType*
>(beforeFrom),
291 dynamic_cast<const ToType*
>(beforeTo));
296 [
this, properType](
const Component* to) {
297 if (
const auto* properTo =
dynamic_cast<const ToType*
>(to))
300 return self->
disconnect(properType, properTo);
306 return this->outVisitor(properType, [&](
const ToType* node) {
return visitor(node); });
316 const auto* properType =
dynamic_cast<const ToType*
>(to);
327 [
this](
bool isMax) {
return isMax ? maximumInDegree() : minimumInDegree(); },
329 [
this, properType]() {
330 std::size_t result = 0;
335 RuntimeInVisitor<ArcTraits>()(
this, properType, [&result](
const Component*) {
342 [
this, properType](
const Component* from) {
343 if (
const auto* properFrom =
dynamic_cast<const FromType*
>(from))
345 return this->contains(properFrom, properType);
352 [
this, properType](
const Component*) {
return false; },
355 return RuntimeInVisitor<ArcTraits>()(
this, properType, visitor);
361 const auto* properType =
dynamic_cast<const ToType*
>(to);
372 [
this](
bool isMax) {
return isMax ? maximumInDegree() : minimumInDegree(); },
374 [
this, properType]() {
375 std::size_t result = 0;
380 RuntimeInVisitor<ArcTraits>()(
this, properType, [&result](
const Component*) {
387 [
this, properType](
const Component* from) {
388 if (
const auto* properFrom =
dynamic_cast<const FromType*
>(from))
390 return this->contains(properFrom, properType);
398 (beforeTo && !
dynamic_cast<const ToType*
>(beforeTo)) ||
399 (beforeFrom && !
dynamic_cast<const FromType*
>(beforeFrom)))
404 if (
const auto* properFrom =
dynamic_cast<const FromType*
>(from))
410 dynamic_cast<const FromType*
>(beforeFrom),
411 dynamic_cast<const ToType*
>(beforeTo));
416 [
this, properType](
const Component* from) {
417 if (
auto* properFrom =
dynamic_cast<const FromType*
>(from))
420 return self->
disconnect(properFrom, properType);
426 return RuntimeInVisitor<ArcTraits>()(
this, properType, visitor);
448 this->outVisitor(from, [&result, &to](
const ToType* node) {
465 bool result = m_data.contains(from, to);
483 typename ResourcePtr,
498 std::function<void(
const std::shared_ptr<smtk::resource::Component>&)> compVisitor =
500 if (
const auto* node =
dynamic_cast<const typename Traits::FromType*
>(component.get()))
505 rsrc->visit(compVisitor);
513 typename ResourcePtr,
528 RuntimeNodeVisitor visitor)
const override
531 return this->visitAllOutgoingNodes(
533 [&](
const typename Traits::FromType* node) {
return visitor(node); });
549 typename ResourcePtr,
564 std::function<void(
const std::shared_ptr<smtk::resource::Component>&)> compVisitor =
566 if (
const auto* node =
dynamic_cast<const typename Traits::ToType*
>(component.get()))
571 rsrc->visit(compVisitor);
579 typename ResourcePtr,
605 typename std::enable_if<U::value, bool>::type
accepts(
608 const FromType* beforeFrom =
nullptr,
609 const ToType* beforeTo =
nullptr)
const
611 return m_data.accepts(from, to, beforeFrom, beforeTo);
617 typename std::enable_if<!U::value, bool>::type
accepts(
620 const FromType* beforeFrom =
nullptr,
621 const ToType* beforeTo =
nullptr)
const
629 if (MaxOutDegree !=
unconstrained() && this->outDegree(from) + 1 >= MaxOutDegree)
638 this->inDegree(to) + 1 >= MaxInDegree)
643 if (this->contains(from, to))
654 bool ok = this->accepts(
655 dynamic_cast<const FromType*
>(from),
656 dynamic_cast<const ToType*
>(to),
657 dynamic_cast<const FromType*
>(beforeFrom),
658 dynamic_cast<const ToType*
>(beforeTo));
671 template<
typename U = Mutable>
673 typename std::enable_if<!U::value, bool>::type
connect(
676 const FromType* beforeFrom =
nullptr,
677 const ToType* beforeTo =
nullptr)
686 template<
typename U = Mutable>
687 typename std::enable_if<U::value, bool>::type
connect(
690 const FromType* beforeFrom =
nullptr,
691 const ToType* beforeTo =
nullptr)
693 bool result = m_data.connect(from, to, beforeFrom, beforeTo);
701 template<
typename U = Mutable>
710 template<
typename U = Mutable>
713 bool result = m_data.disconnect(from, to);
719 template<
typename Functor>
722 return m_data.outVisitor(from, visitor);
733 typename std::enable_if<!U::value && !V::value, std::size_t>::type
outDegree(
739 std::size_t result = 0;
744 this->outVisitor(from, [&result](
const ToType*) { ++result; });
753 typename std::enable_if<!U::value && V::value, std::size_t>::type
outDegree(
759 std::size_t result = 0;
764 this->outVisitor(from, [&result](
const ToType*) { ++result; });
769 reinterpret_cast<const ToType*
>(from), [&result](
const FromType*) { ++result; });
779 std::size_t result = m_data.outDegree(from);
792 typename std::enable_if<!U::value && !V::value, std::size_t>::type
inDegree(
798 std::size_t result = 0;
803 this->inVisitor(to, [&result](
const FromType*) { ++result; });
812 typename std::enable_if<!U::value && V::value, std::size_t>::type
inDegree(
const ToType* to)
const
817 std::size_t result = 0;
822 this->inVisitor(to, [&result](
const ToType*) { ++result; });
826 this->inVisitor(
reinterpret_cast<const ToType*
>(to), [&result](
const ToType*) { ++result; });
834 typename std::enable_if<U::value, std::size_t>::type
inDegree(
const ToType* to)
const
836 std::size_t result = m_data.inDegree(to);
848 return m_data.inVisitor(to, visitor);
858 template<
typename Functor>
861 return this->inVisitorDetail<Functor, true>(to, visitor);
906 template<
typename TraitsType,
typename Const,
typename Outgoing>
910 using Traits = TraitsType;
911 using FromType =
typename TraitsType::FromType;
912 using ToType =
typename TraitsType::ToType;
913 using Directed =
typename TraitsType::Directed;
917 using ThisType =
typename std::
918 conditional<Outgoing::value, typename ImplType::FromType, typename ImplType::ToType>::type;
919 using OtherType =
typename std::
920 conditional<Outgoing::value, typename ImplType::ToType, typename ImplType::FromType>::type;
921 using Constness = Const;
926 This arc type is not indexed for reverse lookups.
934 , m_endpoint(nullptr)
942 typename std::conditional<Const::value, const ThisType*, ThisType*>::type
self()
948 constexpr std::size_t maxDegree()
const
950 return Outgoing::value ? maxOutDegree<Traits>(
unconstrained())
953 constexpr std::size_t minDegree()
const
955 return Outgoing::value ? minOutDegree<Traits>(
unconstrained())
960 template<
bool Outgoingness,
typename Functor>
965 return self->m_arcs->outVisitor(self->m_endpoint, visitor);
969 template<
typename Functor>
974 return self->m_arcs->inVisitor(self->m_endpoint, visitor);
978 template<
bool Outgoingness,
int Dummy = 0>
981 bool operator()(
const SelfEndpoint*
self,
const ToType* endpoint)
const
983 return self->m_arcs->contains(self->m_endpoint, endpoint);
990 bool operator()(
const SelfEndpoint*
self,
const FromType* endpoint)
const
992 return self->m_arcs->contains(endpoint, self->m_endpoint);
998 template<
bool Outgoingness,
int Dummy = 0>
1003 return self->m_arcs->outDegree(self->m_endpoint);
1013 return self->m_arcs->inDegree(self->m_endpoint);
1019 template<
typename Functor>
1035 std::size_t degree()
const
1038 std::size_t dd = Degree<Outgoing::value>()(
this);
1041 std::size_t
size()
const {
return this->degree(); }
1045 bool empty()
const {
return this->size() == 0; }
1060 const OtherType* result =
nullptr;
1061 this->visit([&result](
const OtherType* node) {
1069 const OtherType*
front()
const {
return this->node(); }
1075 template<
bool Mutability,
bool Outgoingness,
int Dummy = 0>
1080 const OtherType* other,
1081 const OtherType* beforeOther =
nullptr,
1082 const ThisType* beforeThis =
nullptr)
const
1084 return self->m_arcs->connect(self->m_endpoint, other, beforeThis, beforeOther);
1093 const OtherType* other,
1094 const OtherType* beforeOther =
nullptr,
1095 const ThisType* beforeThis =
nullptr)
const
1097 return self->m_arcs->connect(other, self->m_endpoint, beforeOther, beforeThis);
1102 template<
bool Outgoingness,
int Dummy>
1107 const OtherType* other,
1108 const OtherType* beforeOther =
nullptr,
1109 const ThisType* beforeThis =
nullptr)
const
1119 template<
bool Mutability,
bool Outgoingness,
int Dummy = 0>
1122 bool operator()(
SelfEndpoint*
self,
const OtherType* other)
const
1124 bool didDisconnect =
self->m_arcs->disconnect(self->m_endpoint, other);
1125 return didDisconnect;
1132 bool operator()(
SelfEndpoint*
self,
const OtherType* other)
const
1134 bool didDisconnect =
self->m_arcs->disconnect(other, self->m_endpoint);
1135 return didDisconnect;
1139 template<
bool Outgoingness,
int Dummy>
1142 bool operator()(
SelfEndpoint*
self,
const OtherType* other)
const
1154 static_assert(!Constness::value,
"A const-referenced node may not be edited.");
1159 bool connect(
const std::shared_ptr<OtherType>& other) {
return this->
connect(other.get()); }
1163 const OtherType* other,
1164 const OtherType* beforeOther =
nullptr,
1165 const ThisType* beforeThis =
nullptr)
1167 static_assert(!Constness::value,
"A const-referenced node may not be edited.");
1174 static_assert(!Constness::value,
"A const-referenced node may not be edited.");
1179 static_assert(!Constness::value,
"A const-referenced node may not be edited.");
1185 bool erase(
const std::shared_ptr<OtherType>& other) {
return this->
erase(other.get()); }
1200 typename std::conditional<Const::value, const ThisType*, ThisType*>::type endpoint)
1202 , m_endpoint(endpoint)
1207 typename std::conditional<Const::value, const ThisType*, ThisType*>::type m_endpoint;
1213 #endif // smtk_graph_ArcImplementation_h
RuntimeArcEndpoint< NonConstArc > outgoingRuntime(const Component *from) override
Return a "container" of outgoing arcs of the given from node.
Definition: ArcImplementation.h:250
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
ArcEndpointInterface< ArcTraits, ConstArc, OutgoingArc > outgoing(const FromType *from) const
Return a "container" of outgoing arcs of the given from node.
Definition: ArcImplementation.h:865
Graph Component represents a node in the graph resource.
Definition: Component.h:62
std::enable_if<!U::value, bool >::type accepts(const FromType *from, const ToType *to, const FromType *beforeFrom=nullptr, const ToType *beforeTo=nullptr) const
Determine whether the given arc is allowed.
Definition: ArcImplementation.h:617
const OtherType * front() const
STL-container synonym for node():
Definition: ArcImplementation.h:1069
bool erase(const OtherType *other)
Connect the other node to this node.
Definition: ArcImplementation.h:1177
@ Halt
Stop visiting items immediately.
bool connect(const OtherType *other)
Connect the other node to this node.
Definition: ArcImplementation.h:1152
detail::SelectArcContainer< ArcTraits, ArcTraits > m_data
Store arc endpoint data.
Definition: ArcImplementation.h:894
True when the order in which arcs are stored is significant.
Definition: ArcProperties.h:207
std::enable_if<!U::value &&!V::value, std::size_t >::type inDegree(const ToType *to) const
Compute the in-degree of the node.
Definition: ArcImplementation.h:792
std::size_t maximumOutDegree() const override
The maximum out-degree of a FromType node. This is enforced.
Definition: ArcImplementation.h:153
std::enable_if< U::value, smtk::common::Visited >::type visitAllOutgoingNodes(ResourcePtr rsrc, Functor ff) const
Visit all nodes which have outgoing arcs of this type.
Definition: ArcImplementation.h:515
smtk::common::Visited inVisitor(const ToType *to, Functor visitor) const
Visit nodes attached via incoming arcs.
Definition: ArcImplementation.h:859
@ All
The visitor was invoked on every item exhaustively.
typename TraitsType ::ToType ToType
The type of node that these arcs point to.
Definition: ArcImplementation.h:64
bool isMutable() const
Return whether arcs of this type may be edited.
Definition: ArcImplementation.h:100
@ Empty
The were no values to visit.
std::enable_if< U::value, bool >::type empty() const
Return true if there are no arcs of this type in the resource.
Definition: ArcImplementation.h:166
std::string typeName() const override
Return the type of arc this class implements.
Definition: ArcImplementation.h:106
std::size_t minimumOutDegree() const override
The minimum out-degree of a FromType node. This is not enforced.
Definition: ArcImplementation.h:149
Directionality
An enumeration indicated whether an arc is directed or undirected.
Definition: Directionality.h:25
Definition: ArcImplementation.h:979
std::enable_if< U::value, std::size_t >::type outDegree(const FromType *from) const
Compute the out-degree of the node.
Definition: ArcImplementation.h:777
bool insert(const OtherType *other, const OtherType *beforeOther=nullptr, const ThisType *beforeThis=nullptr)
Insert a new arc connecting this endpoint to the other.
Definition: ArcImplementation.h:1162
RuntimeArcEndpoint< NonConstArc > incomingRuntime(const Component *to) override
Return a "container" of incoming arcs of the given to node.
Definition: ArcImplementation.h:359
std::enable_if<!U::value, bool >::type disconnect(const FromType *from, const ToType *to)
Remove an arc from from to to.
Definition: ArcImplementation.h:703
bool erase(const std::shared_ptr< OtherType > &other)
A convenience version of erase() that accepts shared pointers.
Definition: ArcImplementation.h:1185
bool disconnect(const OtherType *other)
Disconnect the other node from this one (i.e., erase an arc).
Definition: ArcImplementation.h:1172
bool contains(const OtherType *node) const
Return true if this endpoint is connected to node.
Definition: ArcImplementation.h:1026
RuntimeArcEndpoint< ConstArc > incomingRuntime(const Component *to) const override
Return a "container" of incoming arcs of the given to node.
Definition: ArcImplementation.h:314
bool empty() const
Return whether this endpoint has zero arcs.
Definition: ArcImplementation.h:1045
typename TraitsType ::Directed Directed
If "truthy," this arc is considered directed rather than undirected.
Definition: ArcImplementation.h:60
Check whether the arc traits object (1) is implicit and has methods to insert and remove arcs; or (2)...
Definition: ArcProperties.h:254
Definition: ArcImplementation.h:1120
typename TraitsType ::FromType FromType
The type of node that these arcs originate from.
Definition: ArcImplementation.h:62
Edit methods (only enabled for non-const interfaces).
Definition: ArcImplementation.h:1076
A functor that either calls inVisitor (on arcs with reverse indices) or does nothing.
Definition: ArcImplementation.h:186
An object that a node instance can present to access/edit its outgoing/incoming arcs.
Definition: ArcImplementation.h:39
Checks that can be performed on arc trait-types.
Definition: ArcProperties.h:43
std::enable_if<!U::value &&V::value, std::size_t >::type inDegree(const ToType *to) const
Compute the in-degree of the node.
Definition: ArcImplementation.h:812
ArcEndpointInterface()
This is a dummy constructor that is not used by valid code.
Definition: ArcImplementation.h:932
Visit
Return values common to most visitor methods.
Definition: Visit.h:23
@ Continue
Continue to visit items.
std::enable_if< U::value, bool >::type contains(const FromType *from, const ToType *to) const
Test whether an arc from from to to exists.
Definition: ArcImplementation.h:462
bool disconnect(const std::shared_ptr< OtherType > &other)
A convenience version of disconnect() that accepts shared pointers.
Definition: ArcImplementation.h:1183
std::enable_if< U::value, bool >::type accepts(const FromType *from, const ToType *to, const FromType *beforeFrom=nullptr, const ToType *beforeTo=nullptr) const
Determine whether the given arc is allowed.
Definition: ArcImplementation.h:605
Definition: ArcImplementation.h:999
RuntimeArcEndpoint< ConstArc > outgoingRuntime(const Component *from) const override
Return a "container" of outgoing arcs of the given from node.
Definition: ArcImplementation.h:216
std::enable_if<!U::value &&V::value, std::size_t >::type outDegree(const FromType *from) const
Compute the out-degree of the node.
Definition: ArcImplementation.h:753
std::enable_if<!U::value, smtk::common::Visited >::type visitAllIncomingNodes(ResourcePtr rsrc, Functor ff) const
Visit all nodes which have incoming arcs of this type.
Definition: ArcImplementation.h:551
An object that can query and manipulate arcs at run-time.
Definition: ArcImplementationBase.h:28
smtk::common::Visited outVisitor(const FromType *from, Functor visitor) const
Visit nodes attached via outgoing arcs.
Definition: ArcImplementation.h:720
const OtherType * node() const
Return the first destination endpoint.
Definition: ArcImplementation.h:1058
std::size_t size() const
Return the number of arcs of this type that terminate at this endpoint.
Definition: ArcImplementation.h:1041
bool isOrdered() const
Return whether arcs of this type are ordered (true) or unordered (false).
Definition: ArcImplementation.h:94
bool isDirected() const
Return whether arcs of this type are directed (true) or undirected (false).
Definition: ArcImplementation.h:97
bool isExplicit() const
Return whether arcs of this type are explicit.
Definition: ArcImplementation.h:103
std::enable_if< U::value, smtk::common::Visited >::type visitAllIncomingNodes(ResourcePtr rsrc, Functor ff) const
Visit all nodes which have incoming arcs of this type.
Definition: ArcImplementation.h:581
smtk::common::Visited visit(Functor visitor) const
Visit nodes attached to the endpoint by arcs of this type.
Definition: ArcImplementation.h:1020
std::enable_if< U::value, std::size_t >::type inDegree(const ToType *to) const
Compute the in-degree of the node.
Definition: ArcImplementation.h:834
smtk::common::Visited visitOutgoingNodes(const smtk::graph::ResourceBase *resource, smtk::string::Token arcTypeName, RuntimeNodeVisitor visitor) const override
Visit all nodes with outgoing run-time arcs.
Definition: ArcImplementation.h:525
constexpr std::enable_if< std::is_integral< decltype(T::MaxInDegree)>::value, std::size_t >::type maxInDegree(std::size_t)
Return the maximum in-degree of an arc type (or unconstrained() if unspecified).
Definition: ArcProperties.h:397
A wrapper around arc type-traits classes that provides API.
Definition: ArcImplementation.h:37
Visited
Return value for functions/methods that accept visitors.
Definition: Visit.h:35
std::enable_if<!U::value, smtk::common::Visited >::type visitAllOutgoingNodes(ResourcePtr rsrc, Functor ff) const
Visit all nodes which have outgoing arcs of this type.
Definition: ArcImplementation.h:485
constexpr std::size_t unconstrained()
Return a constant used to indicate the maximimum degree of an arc endpoint is unconstrained.
Definition: ArcProperties.h:30
std::string typeName()
Return the name of a class.
Definition: TypeName.h:289
std::enable_if<!U::value, bool >::type empty() const
Return true if there are no arcs of this type in the resource.
Definition: ArcImplementation.h:175
typename ArcProperties< TraitsType >::isOrdered Ordered
If "truthy," this arc will report incoming/outgoing nodes in a (user-specified) order.
Definition: ArcImplementation.h:66
False when an arc class provides implementations of required methods; true otherwise.
Definition: ArcProperties.h:243
std::enable_if<!U::value &&!V::value, std::size_t >::type outDegree(const FromType *from) const
Compute the out-degree of the node.
Definition: ArcImplementation.h:733
std::size_t maximumInDegree() const override
The maximum in-degree of a ToType node. This is enforced.
Definition: ArcImplementation.h:155
constexpr std::enable_if< std::is_integral< decltype(T::MinInDegree)>::value, std::size_t >::type minInDegree(std::size_t)
Return the minimum in-degree of an arc type (or 0 if unspecified).
Definition: ArcProperties.h:431
A string token identified by an integer.
Definition: Token.h:29
ArcEndpointInterface< ArcTraits, ConstArc, IncomingArc > incoming(const ToType *to) const
Return a "container" of incoming arcs of the given to node.
Definition: ArcImplementation.h:875
Definition: ArcImplementation.h:961
typename ArcProperties< TraitsType >::isExplicit Explicit
If "truthy," arc endpoint connections are explicitly stored by SMTK.
Definition: ArcImplementation.h:76
bool connect(const std::shared_ptr< OtherType > &other)
A convenience version of connect() that accepts shared pointers.
Definition: ArcImplementation.h:1159
std::size_t minimumInDegree() const override
The minimum in-degree of a ToType node. This is not enforced.
Definition: ArcImplementation.h:151
std::enable_if< U::value, bool >::type disconnect(const FromType *from, const ToType *to)
Remove an arc from from to to.
Definition: ArcImplementation.h:711
std::enable_if<!U::value, bool >::type contains(const FromType *from, const ToType *to) const
Test whether an arc from from to to exists.
Definition: ArcImplementation.h:438
A base class for all arc implementations.
Definition: ArcImplementationBase.h:34
A non-templated base class for graph resources.
Definition: ResourceBase.h:35
std::enable_if<!U::value, bool >::type connect(const FromType *from, const ToType *to, const FromType *beforeFrom=nullptr, const ToType *beforeTo=nullptr)
Insert an arc from from to to, optionally ordered by beforeFrom and beforeTo.
Definition: ArcImplementation.h:673
typename ArcProperties< TraitsType >::isMutable Mutable
If "truthy," methods that edit arcs may sometimes return true.
Definition: ArcImplementation.h:74
std::enable_if< U::value, bool >::type connect(const FromType *from, const ToType *to, const FromType *beforeFrom=nullptr, const ToType *beforeTo=nullptr)
Insert an arc from from to to, optionally ordered by beforeFrom and beforeTo.
Definition: ArcImplementation.h:687
smtk::shared_ptr< smtk::resource::Component > ComponentPtr
Definition: PublicPointerDefs.h:297
Provide no default arc storage.
Definition: TypeTraits.h:37
A base class for arc-types defined at runtime.
Definition: ArcImplementation.h:33
A template for accepting visitors with different return types.
Definition: Visit.h:56