Guest User

Untitled

a guest
Apr 24th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.41 KB | None | 0 0
  1. #include "graph.h"
  2. using namespace std;
  3.  
  4. class Vertex
  5. {
  6.     Vertex(char* Value);
  7.     ~Vertex();
  8.    
  9.     char* vtxValue;
  10.     public:
  11.         void setValue(char* Value)
  12.         {
  13.             vrtxValue = Value;
  14.         }
  15.         char* getValue()
  16.         {
  17.             return vtxValue;
  18.         }
  19. };
  20.  
  21. class Edge
  22. {
  23.     Edge(Vertex* One, Vertex* Two, char* Name);
  24.     ~Edge();
  25.    
  26.     Vertex* vtxOne;
  27.     Vertex* vtxTwo;
  28.     char* edgeName;
  29.  
  30.     public:
  31.         void setOne(Vertex* vertOne)
  32.         {
  33.             vtxOne = vertOne;
  34.         }
  35.         void setTwo(Vertex* vertTwo)
  36.         {
  37.             vtxTwo = vertTwo;
  38.         }
  39.         Vertex* getOne()
  40.         {
  41.             return vtxOne
  42.         }
  43.         Vertex* getTwo()
  44.         {
  45.             return vtxTwo
  46.         }
  47.         void setName(char* nName)
  48.         {
  49.             edgeName = nName;
  50.         }
  51.         char* getName()
  52.         {
  53.             return edgeName;
  54.         }
  55. };
  56.  
  57. class GraphDracula
  58. {
  59.     GraphDracula();
  60.     ~GraphDracula();
  61.  
  62.     list<Vertex> Vertexes;
  63.     list<Edge> Edges;
  64.  
  65.     public:
  66.         void addVertex(char* nValue)
  67.         {              
  68.             Vertexes.add( new Vertex(nValue));
  69.         }
  70.         void addEdge(Vertex* nOne, Vertex* nTwo, char* nName)
  71.         {
  72.             Edges.add( new Edge(nOne, nTwo, nName);
  73.         }
  74.         void removeVertex(char* eValue)
  75.         {
  76.             Vertexes.erase(;
  77.         }
  78.         void removeEdge(Vertex* eOne, Vertex* eTwo, char* eName)
  79.         {
  80.             Edges.erase(
  81.         }
  82.         list<Vertex> getVertexes();
  83.         list<Edge> getEdges();
  84.         bool CheckVertex(char* vValue);
  85.         bool CheckEdge(Vertex* vOne, Vertex* vTwo, char* vName);
  86.         list<Edge> getNeighbours();
  87. };
  88.  
  89. class Exception
  90. {
  91.     Exception();
  92.     ~Exception();
  93. };
Add Comment
Please, Sign In to add comment