GNGEdge Class Reference

Represents an UNDIRECTED edge between two nodes. More...

#include <GNGEdge.hpp>

List of all members.

Public Member Functions

 GNGEdge (GNGNode *h1, GNGNode *h2)
 Constructs a new GNGEdge given 2 nodes.

virtual ~GNGEdge ()
GNGNode const & GetOtherNode (GNGNode const &node) const
 Given a node, retreives the other node of the edge.

GNGNodeGetOtherNode (GNGNode const &node)
 Given a node, retreives the other node of the edge.

GNGNodeGetNode1 () const
 Returns the first node of the edge.

GNGNodeGetNode2 () const
 Returns the second node of the edge.

double GetAge ()
 Returns the current age of the edge.

void SetAge (double d)
 Sets the current age of the edge.


Protected Attributes

double m_age
GNGNodem_node1
GNGNodem_node2

Friends

bool operator== (GNGEdge const &e1, GNGEdge const &e2)
bool operator< (GNGEdge const &e1, GNGEdge const &e2)


Detailed Description

Represents an UNDIRECTED edge between two nodes.

When an edge is created it is given two nodes that it will register with. When it is deleted it will again notify the relevant nodes.


Constructor & Destructor Documentation

GNGEdge GNGNode h1,
GNGNode h2
 

Constructs a new GNGEdge given 2 nodes.

Parameters:
h1 the first node
h2 the second node

~GNGEdge  )  [virtual]
 


Member Function Documentation

GNGNode const & GetOtherNode GNGNode const &  node  )  const
 

Given a node, retreives the other node of the edge.

Parameters:
node the node at one end of the edge.
Returns:
the node at the other end of the edge.

GNGNode & GetOtherNode GNGNode const &  node  ) 
 

Given a node, retreives the other node of the edge.

Parameters:
node the node at one end of the edge.
Returns:
the node at the other end of the edge.

GNGNode & GetNode1  )  const
 

Returns the first node of the edge.

Returns:
the first node of the edge.

GNGNode & GetNode2  )  const
 

Returns the second node of the edge.

Returns:
the second node of the edge.

double GetAge  ) 
 

Returns the current age of the edge.

Returns:
the age of the edge.

void SetAge double  d  ) 
 

Sets the current age of the edge.

Parameters:
d the new age.


Friends And Related Function Documentation

bool operator== GNGEdge const &  e1,
GNGEdge const &  e2
[friend]
 

bool operator< GNGEdge const &  e1,
GNGEdge const &  e2
[friend]
 


Member Data Documentation

double m_age [protected]
 

GNGNode* m_node1 [protected]
 

GNGNode* m_node2 [protected]
 


Generated on Mon Mar 22 16:40:49 2004 for GNG_GL by doxygen 1.3.6