00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef Graph_h
00027 #define Graph_h
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #ifndef _bool_h
00044 #include "bool.h"
00045 #endif
00046
00047 #include <iostream.h>
00048
00049 #include <Vertex.h>
00050 #include <VertexIter.h>
00051 #include <TaggedObjectStorage.h>
00052
00053
00067 class Graph
00068 {
00069 public:
00075 Graph();
00076
00082 Graph(int numVertices);
00083
00089 Graph(TaggedObjectStorage &theVerticesStorage);
00090
00096 virtual ~Graph();
00097
00098
00108 virtual bool addVertex(Vertex *vertexPtr, bool checkAdjacency = true);
00109
00120 virtual int addEdge(int vertexTag, int otherVertexTag);
00121
00122
00129 virtual Vertex *getVertexPtr(int vertexTag);
00130
00135 virtual VertexIter &getVertices(void);
00136
00141 virtual int getNumVertex(void) const;
00142
00147 virtual int getNumEdge(void) const;
00148
00158 virtual Vertex *removeVertex(int tag, bool removeEdgeFlag = true);
00159
00160
00165 virtual void Print(ostream &s, int flag =0);
00166
00170 friend ostream &operator<<(ostream &s, Graph &M);
00171
00172
00173 protected:
00174
00175 private:
00177 TaggedObjectStorage *myVertices;
00178
00180 VertexIter *theVertexIter;
00182 int numEdge;
00183 };
00184
00185 #endif
00186