Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members  

gtc::_base_graph< K, W, T >::edge Class Template Reference

Represents an edge in the graph. More...

#include <graph.h>

List of all members.

Public Methods

 edge (const K &k1, const K &k2, const W &w=0)
bool operator== (const edge &e) const
bool operator!= (const edge &e) const
const K & key1 () const
 Returns the key value of the node on one side of the edge.

const K & key2 () const
 Returns the key value of the node on one side of the edge.

const K & key (const K &k)
 Returns the key value of the node opposite the node key given. More...

K & weight ()
 Reterns reference to weight of the edge (if graph is weighted).


Detailed Description

template<typename K, typename W, typename T>
class gtc::_base_graph< K, W, T >::edge

Represents an edge in the graph.

An edge is represented using the key values of two nodes, which indicates that an edge exists between those two nodes. This class is referenced by an edge_iterator when using an edge_iterator to navigate edges extending from a node. You may use the key1 and key2 members to access the key values of the nodes connected by the edge. Also, you may use the key() function, passing the key value of one side of the edge, to retrieve the key value of the other side.

Note that an edge represented by this class is stored with the lower key value in key1.


Member Function Documentation

template<typename K, typename W, typename T>
const K & gtc::_base_graph< K, W, T >::edge::key const K &    k
 

Returns the key value of the node opposite the node key given.

You may use this function with a given key value to retrieve the key value of the opposite side of the edge. This may be convenient when navigating among the edges of a given node in that you already know the key value of the "from" node, and you are looking for the "to" nodes.

Note that the key value supplied must be a valid key value of one of the nodes associated with the edge.


The documentation for this class was generated from the following file:
Generated on Thu Oct 16 10:50:10 2003 for C++ GTC by doxygen1.2.15