17#ifndef CYBER_SERVICE_DISCOVERY_CONTAINER_GRAPH_H_
18#define CYBER_SERVICE_DISCOVERY_CONTAINER_GRAPH_H_
22#include <unordered_map>
28namespace service_discovery {
48 explicit Vertice(
const std::string& val =
"");
57 const std::string&
GetKey()
const;
59 const std::string&
value()
const {
return value_; }
76 std::string
GetKey()
const;
84 const std::string&
value()
const {
return value_; }
85 void set_value(
const std::string& val) { value_ = val; }
95 using VerticeSet = std::unordered_map<std::string, Vertice>;
108 struct RelatedVertices {
114 using EdgeInfo = std::unordered_map<std::string, RelatedVertices>;
116 void InsertOutgoingEdge(
const Edge& e);
117 void InsertIncomingEdge(
const Edge& e);
118 void InsertCompleteEdge(
const Edge& e);
119 void DeleteOutgoingEdge(
const Edge& e);
120 void DeleteIncomingEdge(
const Edge& e);
121 void DeleteCompleteEdge(
const Edge& e);
122 bool LevelTraverse(
const Vertice& start,
const Vertice& end);
void set_value(const std::string &val)
void set_src(const Vertice &v)
void set_dst(const Vertice &v)
const std::string & value() const
const Vertice & src() const
std::string GetKey() const
Edge & operator=(const Edge &rhs)
bool operator==(const Edge &rhs) const
const Vertice & dst() const
std::unordered_map< std::string, VerticeSet > AdjacencyList
void Insert(const Edge &e)
FlowDirection GetDirectionOf(const Vertice &lhs, const Vertice &rhs)
void Delete(const Edge &e)
std::unordered_map< std::string, Vertice > VerticeSet
bool operator==(const Vertice &rhs) const
const std::string & GetKey() const
bool operator!=(const Vertice &rhs) const
Vertice & operator=(const Vertice &rhs)
const std::string & value() const
FlowDirection
describe the flow direction between nodes As the DAG below A-—>B--—>C<--—D GetDirectionOf(A,...