1 #ifndef __DIADES__GRAPH__EDGE__HH 2 #define __DIADES__GRAPH__EDGE__HH 6 #include <boost/functional/hash.hpp> 20 using std::stringstream;
70 require(Exception, data !=
nullptr,
71 "Edge: there is no data (nullptr)");
72 require(Exception, data !=
nullptr,
73 "Edge: there is no data (nullptr)");
161 return !(*
this == edge);
171 return ( (*
this != edge) && !(*
this < edge));
180 "id(): invalid edge");
196 return sizeof (
Edge);
212 require(Exception, _eData !=
nullptr,
"Edge::sourcePos: _eData is null");
222 require(Exception, _eData !=
nullptr,
"Edge::targetPos: _eData is null");
243 require(Exception,
valid(),
"Edge::destroy: invalid edge");
248 ensure(Exception, !
valid(),
"Edge::destroy: valid edge");
296 _inEdges.push_back(
Edge(eData));
298 return --_inEdges.end();
308 _outEdges.push_back(
Edge(eData));
310 return --_outEdges.end();
friend ostream & operator<<(ostream &os, const Edge &edge)
void changeTarget(NodeData *t)
NodeData * _source
identifier of the Edge
Edge & operator=(const Edge &edge)=default
void create(EdgeId idt, NodeData *s, NodeData *t)
NodeData * _target
pointer to the NodeData source of the Edge
const Graph & owner() const
list< Edge >::iterator delInEdge(EdgeData *eData)
list< Edge >::iterator sourcePos() const
data associated with the current Edge
#define ensure(Exception, expr, message)
bool operator==(const Edge &edge) const
list< Edge >::iterator delOutEdge(EdgeData *eData)
Diades::Utils::Exception< Edge > Exception
list< Edge >::iterator _sourcePos
pointer to the NodeData source of the Edge
size_t operator()(Diades::Graph::Edge const &edge) const
std::size_t hash_value(Diades::Graph::Edge const &e)
#define require(Exception, expr, message)
Namespace of the Diades project.
list< Edge >::iterator newOutEdge(EdgeData *eData)
bool operator>(const Edge &edge) const
list< Edge >::iterator LocalEdgeIterator
bool operator<(const Edge &edge) const
list< Edge >::iterator OutEdgeIterator
boost::adjacency_list Graph
list< Edge >::iterator newInEdge(EdgeData *eData)
list< Edge >::iterator InEdgeIterator
list< Edge >::iterator targetPos() const
list< Edge >::iterator _targetPos
position of the Edge in the list of Edge associated with the source Node
vector< Edge >::size_type EdgeId
const Node & sourceRef() const
void changeSource(NodeData *s)
bool operator!=(const Edge &edge) const
const Node & targetRef() const