Generic Edge. More...

#include <rgenericvertex.h>

Inheritance diagram for RGenericEdge< V, E >:
[legend]
Collaboration diagram for RGenericEdge< V, E >:
[legend]

Public Member Functions

int Compare (const RGenericEdge &e) const
 
V * GetFrom (void) const
 
V * GetTo (void) const
 
double GetWeight (void) const
 
bool IsConnect (size_t id) const
 
 RGenericEdge (V *f, V *t, double w)
 
void SetWeight (double weight)
 
virtual ~RGenericEdge (void)
 

Private Attributes

V * From
 
V * To
 
double Weight
 

Detailed Description

template<class V, class E>
singleton R::RGenericEdge< V, E >

Generic Edge.

The RGenericVertex class provides a representation for a generic edge from one vertex to another one in a given graph. The edge is directed but may be considered as undirected in some situations.

Template Parameters
VClass representing a vertex. It must inherits from RVertex.
EClass representing an edge. It must inherits from REdge.

Constructor & Destructor Documentation

RGenericEdge ( V *  f,
V *  t,
double  w 
)

Constructor of the edge.

Parameters
fVertex starting the edge.
tVertex ending the edge.
wWeight
virtual ~RGenericEdge ( void  )
virtual

Destruct the edge. It is eventually removed from the corresponding vertices.

Member Function Documentation

int Compare ( const RGenericEdge< V, E > &  e) const

The methods used to compare two edges. The function returns the same type of information than the strcmp function from the standard C library.

See also
R::RContainer.
Parameters
eEdge used for the comparison.
V* GetFrom ( void  ) const

Get the starting vertex of the edge.

Returns
a pointer.
V* GetTo ( void  ) const

Get the ending vertex of the edge.

Returns
a pointer.
bool IsConnect ( size_t  id) const

Look if the edge connects the node given by the identifier.

Parameters
idIdentifier.
Returns
true if the connects a node.
double GetWeight ( void  ) const

Get the weight of the edge.

void SetWeight ( double  weight)

Set the weight of the edge.

Parameters
weightWeight to assign.

Member Data Documentation

V* From
private

Origin of the edge.

V* To
private

Destination of the edge.

double Weight
private

Weight of the edge.