CSCI 3081 - Drone Delivery System
graph.h
1 #ifndef GRAPH_H_
2 #define GRAPH_H_
3 
4 #include <string>
5 #include <vector>
6 
7 namespace entity_project {
8 
9 class IGraphNode;
10 
12 class IGraph {
13 public:
15  virtual ~IGraph() {}
17  virtual const IGraphNode* GetNode(const std::string& name) const = 0;
19  virtual const std::vector<IGraphNode*>& GetNodes() const = 0;
28  virtual const std::vector< std::vector<float> >
29  GetPath(std::vector<float> src, std::vector<float> dest) const = 0;
30 };
31 
33 class IGraphNode {
34 public:
36  virtual ~IGraphNode() {}
38  virtual const std::string& GetName() const = 0;
40  virtual const std::vector<IGraphNode*>& GetNeighbors() const = 0;
42  virtual const std::vector<float> GetPosition() const = 0;
43 };
44 
45 }
46 
47 #endif
virtual ~IGraphNode()
Destructor.
Definition: graph.h:36
Represents a node in a graph object.
Definition: graph.h:33
virtual ~IGraph()
Destructor.
Definition: graph.h:15
Represents a read only graph object.
Definition: graph.h:12
virtual const IGraphNode * GetNode(const std::string &name) const =0
Gets a node in the graph by name.
virtual const std::vector< IGraphNode * > & GetNodes() const =0
Gets all nodes in the graph.
Definition: entity.h:7
virtual const std::vector< std::vector< float > > GetPath(std::vector< float > src, std::vector< float > dest) const =0
Returns a vector of float vectors that represent a path from src to dest.