OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
GraphNode.h
Go to the documentation of this file.
1#pragma once
2#include <list>
3#include <memory>
4#include <string>
5
6struct EdgeInfo
7{
8 std::string thisNodePort;
9 std::string succeedingNodePort;
10};
11
13{
14public:
15 GraphNode(int nodeID);
16 virtual ~GraphNode() {};
17 const int getNodeID() const { return _nodeID; }
18
19 void addSucceedingNode(const std::shared_ptr<GraphNode> node, EdgeInfo edgeInfo);
20 void addPreviousNode(const std::shared_ptr<GraphNode> node);
21
22 int getRankIncomming() const;
23 int getRankOutgoing() const;
24
25 const std::list<std::shared_ptr<GraphNode>>& getSucceedingNodes() const;
26 const std::list<std::pair<std::shared_ptr<GraphNode>, EdgeInfo>>& getSucceedingNodesWithEdgeInfo() const;
27 const std::list<std::shared_ptr<GraphNode>>& getPreviousNodes() const;
28
29private:
30 int _nodeID;
31 std::list<std::pair<std::shared_ptr<GraphNode>,EdgeInfo>> _succeedingNodesWithEdgeInfo;
32 std::list<std::shared_ptr<GraphNode>> _succeedingNodes;
33 std::list<std::shared_ptr<GraphNode>> _previousNodes;
34};
Definition GraphNode.h:13
const std::list< std::shared_ptr< GraphNode > > & getSucceedingNodes() const
Definition GraphNode.cpp:28
void addSucceedingNode(const std::shared_ptr< GraphNode > node, EdgeInfo edgeInfo)
Definition GraphNode.cpp:7
virtual ~GraphNode()
Definition GraphNode.h:16
GraphNode(int nodeID)
Definition GraphNode.cpp:3
int getRankIncomming() const
Definition GraphNode.cpp:18
const int getNodeID() const
Definition GraphNode.h:17
const std::list< std::shared_ptr< GraphNode > > & getPreviousNodes() const
Definition GraphNode.cpp:38
int getRankOutgoing() const
Definition GraphNode.cpp:23
const std::list< std::pair< std::shared_ptr< GraphNode >, EdgeInfo > > & getSucceedingNodesWithEdgeInfo() const
Definition GraphNode.cpp:33
void addPreviousNode(const std::shared_ptr< GraphNode > node)
Definition GraphNode.cpp:13
Definition GraphNode.h:7
std::string thisNodePort
Definition GraphNode.h:8
std::string succeedingNodePort
Definition GraphNode.h:9