SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
A wrapper around arc type-traits classes that provides explicit storage of arcs. More...
#include <ExplicitArcs.h>
Public Types | |
using | Traits = ArcTraits |
using | FromType = typename ArcTraits::FromType |
using | ToType = typename ArcTraits::ToType |
using | Directed = typename ArcTraits::Directed |
using | Ordered = std::false_type |
using | Mutable = typename ArcProperties< ArcTraits >::isMutable |
using | BidirIndex = negation< typename ArcProperties< ArcTraits >::template hasOnlyForwardIndex< ArcTraits > > |
using | UUID = smtk::common::UUID |
using | NoBadIndexing = disjunction< Directed, conjunction< negation< Directed >, BidirIndex > > |
Public Member Functions | |
template<typename Resource , typename Functor > | |
smtk::common::Visited | visitAllOutgoingNodes (Resource rr, Functor ff) const |
Visit every node which has outgoing arcs of this type. | |
template<typename Resource , typename Functor > | |
smtk::common::Visited | visitAllIncomingNodes (Resource rr, Functor ff) const |
Visit every node which has incoming arcs of this type. | |
template<typename Functor > | |
smtk::common::Visited | outVisitor (const FromType *node, Functor ff) const |
Visit outgoing arcs from a node. | |
template<typename Functor > | |
smtk::common::Visited | inVisitor (const ToType *node, Functor ff) const |
Visit incoming arcs to a node. | |
bool | contains (const FromType *from, const ToType *to) const |
Return true if an arc exists between from and to. | |
std::size_t | outDegree (const FromType *node) const |
Return the number of outgoing arcs from the node. | |
std::size_t | inDegree (const ToType *node) const |
Return the number of incoming arcs to the node. | |
template<bool MM = Mutable::value> | |
std::enable_if<!MM, 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. More... | |
template<bool MM = Mutable::value> | |
std::enable_if< MM, bool >::type | connect (const FromType *from, const ToType *to, const FromType *beforeFrom=nullptr, const ToType *beforeTo=nullptr) |
template<bool MM = Mutable::value> | |
std::enable_if<!MM, bool >::type | disconnect (const FromType *from, const ToType *to) |
Remove an arc from from to to, optionally ordered by beforeFrom and beforeTo. More... | |
template<bool MM = Mutable::value> | |
std::enable_if< MM, bool >::type | disconnect (const FromType *from, const ToType *to) |
Static Public Attributes | |
static constexpr std::size_t | MaxOutDegree = maxOutDegree<ArcTraits>(unconstrained()) |
static constexpr std::size_t | MaxInDegree = maxInDegree<ArcTraits>(unconstrained()) |
static constexpr std::size_t | MinOutDegree = maxOutDegree<ArcTraits>(unconstrained()) |
static constexpr std::size_t | MinInDegree = maxInDegree<ArcTraits>(unconstrained()) |
Protected Attributes | |
std::unordered_map< const FromType *, std::unordered_set< const ToType * > > | m_forward |
std::unordered_map< const ToType *, std::unordered_set< const FromType * > > | m_reverse |
A wrapper around arc type-traits classes that provides explicit storage of arcs.
|
inline |
Insert an arc from from to to, optionally ordered by beforeFrom and beforeTo.
If the arc is ordered, then beforeFrom indicates where from should be placed in the order of incoming nodes and similarly for beforeTo and to. If the arc is not ordered, then beforeFrom and beforeTo are ignored.
|
inline |
Remove an arc from from to to, optionally ordered by beforeFrom and beforeTo.
If the arc is ordered, then beforeFrom indicates where from should be placed in the order of incoming nodes and similarly for beforeTo and to. If the arc is not ordered, then beforeFrom and beforeTo are ignored.