Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "graph.h"
- using namespace std;
- class Vertex
- {
- Vertex(char* Value);
- ~Vertex();
- char* vtxValue;
- public:
- void setValue(char* Value)
- {
- vrtxValue = Value;
- }
- char* getValue()
- {
- return vtxValue;
- }
- };
- class Edge
- {
- Edge(Vertex* One, Vertex* Two, char* Name);
- ~Edge();
- Vertex* vtxOne;
- Vertex* vtxTwo;
- char* edgeName;
- public:
- void setOne(Vertex* vertOne)
- {
- vtxOne = vertOne;
- }
- void setTwo(Vertex* vertTwo)
- {
- vtxTwo = vertTwo;
- }
- Vertex* getOne()
- {
- return vtxOne
- }
- Vertex* getTwo()
- {
- return vtxTwo
- }
- void setName(char* nName)
- {
- edgeName = nName;
- }
- char* getName()
- {
- return edgeName;
- }
- };
- class GraphDracula
- {
- GraphDracula();
- ~GraphDracula();
- list<Vertex> Vertexes;
- list<Edge> Edges;
- public:
- void addVertex(char* nValue)
- {
- Vertexes.add( new Vertex(nValue));
- }
- void addEdge(Vertex* nOne, Vertex* nTwo, char* nName)
- {
- Edges.add( new Edge(nOne, nTwo, nName);
- }
- void removeVertex(char* eValue)
- {
- Vertexes.erase(;
- }
- void removeEdge(Vertex* eOne, Vertex* eTwo, char* eName)
- {
- Edges.erase(
- }
- list<Vertex> getVertexes();
- list<Edge> getEdges();
- bool CheckVertex(char* vValue);
- bool CheckEdge(Vertex* vOne, Vertex* vTwo, char* vName);
- list<Edge> getNeighbours();
- };
- class Exception
- {
- Exception();
- ~Exception();
- };
Add Comment
Please, Sign In to add comment