Mace C++ Graph Library 1.0
The fast and flexible graph library for C++. Developed by Matthias Mace Hädrich.
Public Member Functions | Private Attributes
edge Class Reference

The class that represents an edge in a graph. More...

#include <edge.h>

List of all members.

Public Member Functions

 edge (vertex *dest, int weight=0)
 The constructor.
virtual ~edge ()
 The destructor.
int weight ()
 Return the current weight for the edge or 0 if no weight is set.
void set_weight (int weight)
 Set the weight of the edge.
vertexdest ()
 Return the destination vertex of the edge.
void set_dest (vertex *p_dest)
 Set a (new) destination vertex for the edge.

Private Attributes

std::string m_name
int m_weight
vertexm_dest

Detailed Description

The class that represents an edge in a graph.

An edge always contains a weight (weight = 0 if none is set) and a destination vertex.

Definition at line 22 of file edge.h.


Constructor & Destructor Documentation

edge::edge ( vertex dest,
int  weight = 0 
)

The constructor.

An edge is initialized by handing over a destination vertex dest.
Additionaly a weight weight can be set, which is 0 by default.

Definition at line 12 of file edge.cpp.

edge::~edge ( ) [virtual]

The destructor.

Definition at line 21 of file edge.cpp.


Member Function Documentation

vertex * edge::dest ( )

Return the destination vertex of the edge.

Definition at line 45 of file edge.cpp.

void edge::set_dest ( vertex p_dest)

Set a (new) destination vertex for the edge.

Definition at line 58 of file edge.cpp.

void edge::set_weight ( int  weight)

Set the weight of the edge.

Weight is supposed to be an integer value. Other values will be converted into int implicitly.

Definition at line 37 of file edge.cpp.

int edge::weight ( )

Return the current weight for the edge or 0 if no weight is set.

Definition at line 28 of file edge.cpp.


Member Data Documentation

vertex* edge::m_dest [private]

Definition at line 37 of file edge.h.

std::string edge::m_name [private]

Definition at line 35 of file edge.h.

int edge::m_weight [private]

Definition at line 36 of file edge.h.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Defines