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 | |
ExplicitArcs (Traits &&traits) | |
ExplicitArcs (const Traits &traits) | |
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 | accepts (const FromType *from, const ToType *to, const FromType *beforeFrom=nullptr, const ToType *beforeTo=nullptr) const |
Check whether an arc from from to to is acceptable. More... | |
template<bool MM = Mutable::value> | |
std::enable_if< MM, bool >::type | accepts (const FromType *from, const ToType *to, const FromType *beforeFrom=nullptr, const ToType *beforeTo=nullptr) const |
bool | 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 | 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) |
bool | empty () const |
Return true if there are no arcs stored. | |
std::size_t | size () const |
Return the number of arcs stored. | |
const Traits & | traits () const |
Return the traits object that ExplicitArcs is storing arcs for. | |
Traits & | traits () |
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()) |
A wrapper around arc type-traits classes that provides explicit storage of arcs.
|
inline |
Check whether an arc from from to to is acceptable.
This will not make any modifications; it simply checks whether the arc is allowed.
|
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.