12#ifndef WSFCOMMGRAPH_HPP
13#define WSFCOMMGRAPH_HPP
15#include "wsf_export.h"
20#include "UtScriptAccessible.hpp"
21#include "UtScriptClassDefine.hpp"
35using GraphImpl = UtGraphT<Node, Edge, true, double>;
81 void Destroy(
void* aNodePtr)
override;
100 Edge(
bool aEnabled,
const Address& aSourceAddress,
const Address& aDestinationAddress);
132 void Destroy(
void* aEdgePtr)
override;
172 virtual Edge*
InsertEdge(
const Node* aSourceNode,
const Node* aDestinationNode,
bool aIsEnabled,
bool aIsStatic =
false);
174 const Address& aDestinationAddress,
176 bool aIsStatic =
false);
184 std::vector<const Node*>
GetNodes()
const;
211 bool FindPath(
const Node* aSourceNode,
212 const Node* aDestinationNode,
213 GraphImpl::NodeList& aPath,
215 const GraphImpl::cost_func* aCostClass =
nullptr)
const;
216 bool FindPath(
const Address& aSourceAddress,
217 const Address& aDestinationAddress,
220 const GraphImpl::cost_func* aCostClass =
nullptr)
const;
223 bool FindAnyPath(
const Address& aSourceAddress,
224 const Address& aDestinationAddress,
227 const GraphImpl::cost_func* aCostClass =
nullptr)
const;
236 bool mUserModifiable{
false};
bool operator!=(int aId, const WsfStringInt &aRhs)
Not equal relational operator for the case of an integer on the LHS and a StringId on the RHS.
Definition WsfStringId.hpp:75
bool operator==(int aId, const WsfStringInt &aRhs)
Equal relational operator for the case of an integer on the LHS and a StringId on the RHS.
Definition WsfStringId.hpp:69
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
Definition WsfCommAddress.hpp:57
Definition WsfCommGraph.hpp:98
Edge(const Edge &aSrc)=default
void SetStatic(bool aIsStatic)
Definition WsfCommGraph.hpp:112
const Address & GetSourceAddress() const
Definition WsfCommGraph.hpp:107
bool IsStatic() const
Definition WsfCommGraph.hpp:115
bool IsEnabled() const
Definition WsfCommGraph.hpp:114
void SetWeight(double aWeight)
Definition WsfCommGraph.hpp:113
Edge(bool aEnabled, const Address &aSourceAddress, const Address &aDestinationAddress)
Definition WsfCommGraph.cpp:90
double GetWeight() const
Definition WsfCommGraph.hpp:109
const Address & GetDestinationAddress() const
Definition WsfCommGraph.hpp:108
Edge & operator=(const Edge &aRhs)=default
void SetDisabled()
Definition WsfCommGraph.hpp:111
void SetEnabled()
Definition WsfCommGraph.hpp:110
const char * GetScriptClassName() const override
Definition WsfCommGraph.hpp:117
virtual Edge * Clone() const
Definition WsfCommGraph.cpp:100
virtual const Node * CreateNode(const Address &aAddress)
Definition WsfCommGraph.cpp:162
const char * GetScriptClassName() const override
Definition WsfCommGraph.hpp:231
virtual Edge * InsertEdge(const Node *aSourceNode, const Node *aDestinationNode, bool aIsEnabled, bool aIsStatic=false)
Definition WsfCommGraph.cpp:187
Graph(const Graph &aSrc)=default
virtual Node * FindNode(const Address &aAddress) const
Definition WsfCommGraph.cpp:150
virtual EdgeList GetIncomingNodeEdges(const Node *aNodePtr)
Definition WsfCommGraph.cpp:262
Graph & operator=(const Graph &aRhs)=default
virtual void RemoveNodeEdges(Node *aNode)
Removes all incoming and outgoing edges to this node.
Definition WsfCommGraph.cpp:434
virtual Edge * FindEdge(const Node *aSourceNode, const Node *aDestinationNode)
Definition WsfCommGraph.cpp:238
virtual bool RemoveNode(const Node *aNodePtr)
Definition WsfCommGraph.cpp:169
void SetUserModifiable(bool aCanModify)
Definition WsfCommGraph.hpp:196
virtual EdgeList GetOutgoingNodeEdges(const Node *aNodePtr) const
Definition WsfCommGraph.cpp:289
bool IsUserModifiable() const
Definition WsfCommGraph.hpp:197
virtual EdgeList GetAllNodeEdges(const Node *aNodePtr)
Definition WsfCommGraph.cpp:317
virtual bool EraseEdge(const Node *aSourceNode, const Node *aDestinationNode)
Definition WsfCommGraph.cpp:213
std::vector< const Node * > GetNodes() const
Definition WsfCommGraph.cpp:444
GraphAction
Definition WsfCommGraph.hpp:153
Definition WsfCommGraph.hpp:50
virtual Node * Clone() const
Definition WsfCommGraph.cpp:52
Node & operator=(const Node &aRhs)=default
bool IsEnabled() const
Definition WsfCommGraph.hpp:67
Node(const Address &aAddress)
Definition WsfCommGraph.cpp:27
void SetDisabled()
Definition WsfCommGraph.hpp:66
const char * GetScriptClassName() const override
Definition WsfCommGraph.hpp:69
void SetEnabled()
Definition WsfCommGraph.hpp:65
const Address & GetAddress() const
Definition WsfCommGraph.hpp:63
bool operator<(const Node &aRhs) const
Definition WsfCommGraph.cpp:46
Node(const Node &aSrc)=default
UT_DECLARE_SCRIPT_METHOD(SetEdgeWeight)
UT_DECLARE_SCRIPT_METHOD(FindPath)
UT_DECLARE_SCRIPT_METHOD(CreateNode)
UT_DECLARE_SCRIPT_METHOD(GetOutgoingNodeEdges)
UT_DECLARE_SCRIPT_METHOD(InsertEdge)
UT_DECLARE_SCRIPT_METHOD(GetNodes)
UT_DECLARE_SCRIPT_METHOD(HasEdge)
UT_DECLARE_SCRIPT_METHOD(GetEdge)
ScriptCommGraphClass(const std::string &aClassName, UtScriptTypes *aTypesPtr)
Definition WsfCommGraph.cpp:457
UT_DECLARE_SCRIPT_METHOD(Clear)
UT_DECLARE_SCRIPT_METHOD(EraseEdge)
UT_DECLARE_SCRIPT_METHOD(RemoveNode)
UT_DECLARE_SCRIPT_METHOD(HasNode)
UT_DECLARE_SCRIPT_METHOD(GetNode)
UT_DECLARE_SCRIPT_METHOD(GetIncomingNodeEdges)
UT_DECLARE_SCRIPT_METHOD(SourceAddress)
UT_DECLARE_SCRIPT_METHOD(Weight)
UT_DECLARE_SCRIPT_METHOD(DestinationAddress)
ScriptCommGraphEdgeClass(const std::string &aClassName, UtScriptTypes *aTypesPtr)
Definition WsfCommGraph.cpp:106
void Destroy(void *aEdgePtr) override
Definition WsfCommGraph.cpp:120
UT_DECLARE_SCRIPT_METHOD(IsEnabled)
ScriptCommGraphNodeClass(const std::string &aClassName, UtScriptTypes *aTypesPtr)
Definition WsfCommGraph.cpp:58
UT_DECLARE_SCRIPT_METHOD(GetAddress)
void Destroy(void *aNodePtr) override
Definition WsfCommGraph.cpp:70
UT_DECLARE_SCRIPT_METHOD(IsEnabled)
Definition WsfCommGraph.cpp:22
std::vector< Edge * > EdgeList
Definition WsfCommGraph.hpp:37
std::vector< Address > AddressList
Definition WsfCommGraph.hpp:36
UtGraphT< Node, Edge, true, double > GraphImpl
Definition WsfCommGraph.hpp:35
Definition WsfComm.cpp:34
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32