#include <Graph.h>
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.
Definition at line 192 of file Graph.h.
Public Member Functions | |
Vertex * | AddVertex () |
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. | |
EdgeArray * | GetEdges () |
Returns an EdgeArray of all edges. | |
VertexArray * | GetVertices () |
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 |
EdgeArray * | Edges |
The edges of the graph. | |
friend | Graph |
friend | Vertex |
friend | VertexArray |
VertexArray * | Vertices |
The vertices of the graph. |
|
Creates a new graph.
|
|
Destroys the graph.
|
|
Adds a new vertex to the graph. It is created by the method and a pointer to the new vertex is returned.
|
|
Removes an edge from the graph. The edge is looked up, it is released from the corresponding vertices, and its memory is freed.
|
|
Removes all edges from the graph. All edges are released from their corresponding vertices, and their memory is freed. |
|
Removes a vertex from the graph. The vertex is looked up, all corresponding edges are freed, and its memory is released.
|
|
Removes all vertices from the graph. All vertices' edges are freed, too, and the vertices' memory is released. |
|
Returns an EdgeArray of all edges.
|
|
Returns a VertexArray of all vertices.
|
|
|
|
|
|
|
|
|
|
The edges of the graph.
|
|
|
|
|
|
|
|
The vertices of the graph.
|