SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
An object that can query and manipulate arcs at run-time. More...
#include <RuntimeArcEndpoint.h>
Public Types | |
using | Constness = Const |
using | DegreeLimitsFunctor = std::function< std::size_t(bool)> |
using | ContainsFunctor = std::function< bool(const Component *)> |
using | NodeValenceFunctor = std::function< std::size_t()> |
using | InsertArcFunctor = std::function< bool(const Component *, const Component *, const Component *)> |
using | EraseArcFunctor = std::function< bool(const Component *)> |
using | FullVisitor = std::function< smtk::common::Visit(const Component *)> |
using | FullVisitFunctor = std::function< smtk::common::Visited(FullVisitor)> |
Public Member Functions | |
RuntimeArcEndpoint () | |
Create an "invalid" runtime arc endpoint. More... | |
RuntimeArcEndpoint (const RuntimeArcEndpoint< Const > &)=default | |
Allow objects of this type to be copied. | |
RuntimeArcEndpoint & | operator= (const RuntimeArcEndpoint< Const > &)=default |
RuntimeArcEndpoint (smtk::string::Token arcType, const Component *self, bool isOutgoing, DegreeLimitsFunctor degreeLimitsFunctor, NodeValenceFunctor nodeValenceFunctor, ContainsFunctor containsFunctor, InsertArcFunctor insertArcFunctor, EraseArcFunctor eraseArcFunctor, FullVisitFunctor fullVisitFunctor) | |
bool | valid () const |
A run-time interface may be invalid due to run-time constraints. More... | |
Component * | self () |
std::size_t | maxDegree () const |
std::size_t | minDegree () const |
template<typename Functor > | |
smtk::common::Visited | visit (Functor visitor) const |
bool | contains (const Component *node) const |
bool | contains (const std::shared_ptr< Component > &node) const |
std::size_t | degree () const |
std::size_t | size () const |
bool | empty () const |
const Component * | node () const |
A convenience to return the first node. | |
const Component * | front () const |
STL-container synonym for node(): | |
bool | insert (const Component *other, const Component *beforeOther=nullptr, const Component *beforeThis=nullptr) |
bool | insert (const std::shared_ptr< Component > &other, const std::shared_ptr< Component > &beforeOther=nullptr, const std::shared_ptr< Component > &beforeThis=nullptr) |
bool | connect (const Component *other) |
bool | connect (const std::shared_ptr< Component > &other) |
bool | disconnect (const Component *other) |
bool | disconnect (const std::shared_ptr< Component > &other) |
bool | erase (const Component *other) |
bool | erase (const std::shared_ptr< Component > &other) |
Protected Attributes | |
smtk::string::Token | m_arcTypeName |
Component * | m_endpoint { nullptr } |
bool | m_outgoing { true } |
DegreeLimitsFunctor | m_degreeLimitsFunctor |
NodeValenceFunctor | m_nodeValenceFunctor |
ContainsFunctor | m_containsFunctor |
InsertArcFunctor | m_insertArcFunctor |
EraseArcFunctor | m_eraseArcFunctor |
FullVisitFunctor | m_fullVisitFunctor |
An object that can query and manipulate arcs at run-time.
This class is a run-time analog to ArcEndpointInterface<>; it uses functors provided by templated subclasses to implement operations independent of arc- and node-type.
This allows fast, compile-time, non-virtual graph code to run with low overhead while providing a slower API that is more usable.
It accepts a template parameter, Const, that should be ConstArc if the endpoint is considered "const" and NonConstArc otherwise.
|
inline |
Create an "invalid" runtime arc endpoint.
When you ask for outgoing arcs of a non-existent or improper type, this object is returned to indicate that no arcs of that type exist. Note in particular that minDegree() > maxDegree() for this endpoint (which you can use to test endpoint validity).
|
inline |
A run-time interface may be invalid due to run-time constraints.
This method should be used to test that the node is allowed to be an endpoint for arcs of this type.