DiaDes  0.1
DIAgnosis of Discrete-Event System
EdgeData.hh
Go to the documentation of this file.
1 #ifndef __DIADES__GRAPH__EDGEDATA__HH
2 #define __DIADES__GRAPH__EDGEDATA__HH
3 
4 
5 #include <list>
8 
9 using std::list;
10 using std::vector;
11 
12 namespace Diades {
13  namespace Graph {
14 
15  class Graph;
16 
17 
18  class NodeData;
19 
29  class EdgeData {
30  public:
31 
32  static string typeName() {
33  return "Graph::EdgeData";
34  }
36 
37 
38  public:
39  typedef vector<EdgeData *>::size_type SizeType;
40  typedef vector<Edge>::size_type EdgeId;
41 
42  public:
43 
48  _source(nullptr),
49  _target(nullptr),
50  _sourcePos(),
51  _targetPos() {};
52 
59  EdgeData(EdgeId idt, NodeData * s, NodeData * t) : _identifier(idt),
60  _source(s),
61  _target(t),
62  _sourcePos(),
63  _targetPos() {}
64 
65 
70 
76  void setSourcePos(list<Edge>::iterator sourcePos) {
77  _sourcePos = sourcePos;
78  }
79 
80 
86  void setTargetPos(list<Edge>::iterator targetPos) {
87  _targetPos = targetPos;
88  }
89 
93  SizeType memoryUsage() const {
94  return sizeof (EdgeData);
95  }
96 
101  string details() const;
102 
103  private:
104  SizeType _identifier;
106  mutable NodeData * _source;
108  mutable NodeData * _target;
110  list<Edge>::iterator _sourcePos;
112  list<Edge>::iterator _targetPos;
114 
116  friend class Graph;
118  friend class Edge;
120  friend class NodeData;
121  };
122  };
123 };
124 
125 #endif
NodeData * _source
identifier of the Edge
Definition: EdgeData.hh:106
void setSourcePos(list< Edge >::iterator sourcePos)
Definition: EdgeData.hh:76
NodeData * _target
pointer to the NodeData source of the Edge
Definition: EdgeData.hh:108
EdgeData(EdgeId idt, NodeData *s, NodeData *t)
Definition: EdgeData.hh:59
static string typeName()
Definition: EdgeData.hh:32
void setTargetPos(list< Edge >::iterator targetPos)
Definition: EdgeData.hh:86
Diades::Utils::Exception< EdgeData > Exception
Definition: EdgeData.hh:35
list< Edge >::iterator _sourcePos
pointer to the NodeData source of the Edge
Definition: EdgeData.hh:110
Namespace of the Diades project.
vector< EdgeData * >::size_type SizeType
Definition: EdgeData.hh:39
boost::adjacency_list Graph
Definition: ScaleFree.cc:9
string details() const
Definition: EdgeImpl.hh:24
list< Edge >::iterator _targetPos
position of the Edge in the list of Edge associated with the source Node
Definition: EdgeData.hh:112
vector< Edge >::size_type EdgeId
Definition: EdgeData.hh:40
SizeType memoryUsage() const
Definition: EdgeData.hh:93