Generic Edge. More...

#include <rgenericvertex.h>

Inheritance diagram for RGenericEdge< V, E >:
Collaboration diagram for RGenericEdge< V, E >:

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.

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

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
eEdge used for the comparison.
V* GetFrom ( void  ) const

Get the starting vertex of the edge.

a pointer.
V* GetTo ( void  ) const

Get the ending vertex of the edge.

a pointer.
bool IsConnect ( size_t  id) const

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

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.

weightWeight to assign.

Member Data Documentation

V* From

Origin of the edge.

V* To

Destination of the edge.

double Weight

Weight of the edge.