Type of a undirected edge (or arc). More...
#include <edge.h>
Public Types | |
typedef EdgeContent | content_t |
typedef Edge< EdgeContent > | edge_t |
typedef edge_identity_t | identity_t |
Type of the identity of a vertex. | |
Public Member Functions | |
Arc (identity_t src, identity_t tgt, EdgeContent *c1, EdgeContent *c2) | |
Full constructor -> should never be called by the user. | |
Arc (const Arc ©) | |
Copy constructor. | |
Arc () | |
Cosntruct an empty (null) arc. | |
Arc | inv () const |
Returns the opposite arc. | |
bool | isNull () const |
Test if the content is null. | |
operator bool () const | |
AN arc evaluates to true if it contains some data. | |
operator edge_t () const | |
Convert the current arc into the corresponding edge. | |
EdgeContent & | operator* () const |
Reference the content of the arc. | |
Arc | operator- () const |
Unary '-' operator synchronize edges and returns opposite arc. | |
EdgeContent * | operator-> () const |
Reference the content of the arc as a pointer. | |
identity_t | source () const |
Returns the identifier of the source of the edge. | |
void | sync () const |
Synchronize both sides of the arc. | |
identity_t | target () const |
Returns the identifier of the target of the edge. | |
~Arc () | |
Destroy and copy the content of the arcs. | |
Protected Attributes | |
identity_t | _source |
identity_t | _target |
EdgeContent * | main |
EdgeContent * | other |
Type of a undirected edge (or arc).
When an arc is destroyed, the content of the main edge is copied in the other one.
Note that you should never keep an arc! Is is meant for temporary usage. This is why there is no copy constructor or operator=.
Definition at line 271 of file edge.h.
typedef edge_identity_t graph::Arc< EdgeContent >::identity_t |
graph::Arc< EdgeContent >::Arc | ( | ) | [inline] |
Cosntruct an empty (null) arc.
Definition at line 371 of file edge.h.
Referenced by graph::Arc< EdgeContent >::inv().
graph::Arc< EdgeContent >::Arc | ( | const Arc< EdgeContent > & | copy | ) | [inline] |
graph::Arc< EdgeContent >::Arc | ( | identity_t | src, | |
identity_t | tgt, | |||
EdgeContent * | c1, | |||
EdgeContent * | c2 | |||
) | [inline] |
graph::Arc< EdgeContent >::~Arc | ( | ) | [inline] |
Destroy and copy the content of the arcs.
Definition at line 324 of file edge.h.
References graph::Arc< EdgeContent >::sync().
00324 { sync(); }
Arc< EdgeContent > graph::Arc< EdgeContent >::inv | ( | ) | const [inline] |
Returns the opposite arc.
Careful, it is not synchronized!
Definition at line 396 of file edge.h.
References graph::Arc< EdgeContent >::Arc().
Referenced by graph::Arc< EdgeContent >::operator-().
00397 { 00398 return Arc(_target, _source, other, main); 00399 }
bool graph::Arc< EdgeContent >::isNull | ( | ) | const [inline] |
graph::Arc< EdgeContent >::operator bool | ( | ) | const [inline] |
graph::Arc< EdgeContent >::operator edge_t | ( | ) | const [inline] |
EdgeContent& graph::Arc< EdgeContent >::operator* | ( | ) | const [inline] |
Arc graph::Arc< EdgeContent >::operator- | ( | ) | const [inline] |
Unary '-' operator synchronize edges and returns opposite arc.
Definition at line 319 of file edge.h.
References graph::Arc< EdgeContent >::inv().
00319 { return inv(); }
EdgeContent* graph::Arc< EdgeContent >::operator-> | ( | ) | const [inline] |
identity_t graph::Arc< EdgeContent >::source | ( | ) | const [inline] |
Returns the identifier of the source of the edge.
void graph::Arc< EdgeContent >::sync | ( | ) | const [inline] |
Synchronize both sides of the arc.
Definition at line 363 of file edge.h.
References graph::copy_symmetric().
Referenced by graph::Arc< EdgeContent >::~Arc().
00363 { if(main) copy_symmetric(*other, *main); }
identity_t graph::Arc< EdgeContent >::target | ( | ) | const [inline] |
Returns the identifier of the target of the edge.