// Copyright 2016, University of Freiburg, // Chair of Algorithms and Data Structures. // Authors: Patrick Brosi #ifndef UTIL_GRAPH_GRAPH_H_ #define UTIL_GRAPH_GRAPH_H_ #include #include #include #include #include "util/graph/Edge.h" #include "util/graph/Node.h" namespace util { namespace graph { template class Graph { public: Graph() {} ; Graph(const Graph& g) = delete; Graph(Graph& g) = delete; void operator=(const Graph& other) = delete; void operator=(Graph& other) = delete; virtual ~Graph(); virtual Node* addNd() = 0; virtual Node* addNd(const N& pl) = 0; Edge* addEdg(Node* from, Node* to); virtual Edge* addEdg(Node* from, Node* to, const E& p) = 0; virtual Edge* addEdg(Node* from, Node* to, E&& p) = 0; Edge* getEdg(Node* from, Node* to); const Edge* getEdg(const Node* from, const Node* to) const; virtual Node* mergeNds(Node* a, Node* b) = 0; const std::set*>& getNds() const; static Node* sharedNode(const Edge* a, const Edge* b); typename std::set*>::iterator delNd(Node* n); typename std::set*>::iterator delNd( typename std::set*>::iterator i); void delEdg(Node* from, Node* to); protected: std::set*> _nodes; }; #include "util/graph/Graph.tpp" } // namespace graph } // namespace util #endif // UTIL_GRAPH_GRAPH_H_