Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

Graph Class Reference

#include <Graph.h>

List of all members.


Detailed Description

The Graph class represents a mathematical graph.

It consists of vertices, which may represent objects in the modelled world, and edges, which directionally connect the vertices. Both vertices and edges may carry information, such as an object or memory block.

Author:
Thomas Jacob version 2.00 beta

Definition at line 192 of file Graph.h.

Public Member Functions

VertexAddVertex ()
 Adds a new vertex to the graph.

bool DeleteEdge (class Edge *Edge)
 Removes an edge from the graph.

void DeleteEdges ()
 Removes all edges from the graph.

bool DeleteVertex (class Vertex *Vertex)
 Removes a vertex from the graph.

void DeleteVertices ()
 Removes all vertices from the graph.

EdgeArrayGetEdges ()
 Returns an EdgeArray of all edges.

VertexArrayGetVertices ()
 Returns a VertexArray of all vertices.

 Graph ()
 Creates a new graph.

virtual ~Graph ()
 Destroys the graph.


Private Attributes

friend ArrayList<Edge>
friend ArrayList<Vertex>
friend Edge
friend EdgeArray
EdgeArrayEdges
 The edges of the graph.

friend Graph
friend Vertex
friend VertexArray
VertexArrayVertices
 The vertices of the graph.


Constructor & Destructor Documentation

Graph  ) 
 

Creates a new graph.

virtual ~Graph  )  [virtual]
 

Destroys the graph.


Member Function Documentation

Vertex* AddVertex  ) 
 

Adds a new vertex to the graph.

It is created by the method and a pointer to the new vertex is returned.

Returns:
The new vertex, automatically created by the method.

bool DeleteEdge class Edge Edge  )  [inline]
 

Removes an edge from the graph.

The edge is looked up, it is released from the corresponding vertices, and its memory is freed.

Parameters:
Edge The edge to be deleted.
Returns:
If the deletion was successful.

void DeleteEdges  )  [inline]
 

Removes all edges from the graph.

All edges are released from their corresponding vertices, and their memory is freed.

bool DeleteVertex class Vertex Vertex  )  [inline]
 

Removes a vertex from the graph.

The vertex is looked up, all corresponding edges are freed, and its memory is released.

Parameters:
Vertex The vertex to be deleted.
Returns:
If the deletion was successful.

void DeleteVertices  )  [inline]
 

Removes all vertices from the graph.

All vertices' edges are freed, too, and the vertices' memory is released.

EdgeArray* GetEdges  )  [inline]
 

Returns an EdgeArray of all edges.

Returns:
All edges as EdgeArray.

VertexArray* GetVertices  )  [inline]
 

Returns a VertexArray of all vertices.

Returns:
All vertices as VertexArray.


Member Data Documentation

friend ArrayList<Edge> [private]
 

Definition at line 200 of file Graph.h.

friend ArrayList<Vertex> [private]
 

Definition at line 197 of file Graph.h.

friend Edge [private]
 

Definition at line 198 of file Graph.h.

friend EdgeArray [private]
 

Definition at line 199 of file Graph.h.

EdgeArray* Edges [private]
 

The edges of the graph.

Definition at line 209 of file Graph.h.

friend Graph [private]
 

Definition at line 194 of file Graph.h.

friend Vertex [private]
 

Definition at line 195 of file Graph.h.

friend VertexArray [private]
 

Definition at line 196 of file Graph.h.

VertexArray* Vertices [private]
 

The vertices of the graph.

Definition at line 221 of file Graph.h.


The documentation for this class was generated from the following file:
Generated on Tue Oct 3 00:23:40 2006 for ToolBox by doxygen 1.3.6