17 #ifndef CYBER_SERVICE_DISCOVERY_CONTAINER_GRAPH_H_ 18 #define CYBER_SERVICE_DISCOVERY_CONTAINER_GRAPH_H_ 22 #include <unordered_map> 28 namespace 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>;
101 void Insert(
const Edge& e);
102 void Delete(
const Edge& e);
104 uint32_t GetNumOfEdge();
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);
133 #endif // CYBER_SERVICE_DISCOVERY_CONTAINER_GRAPH_H_
Vertice & operator=(const Vertice &rhs)
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: atomic_rw_lock.h:36
const Vertice & src() const
Definition: graph.h:78
const std::string & GetKey() const
FlowDirection
describe the flow direction between nodes As the DAG below A-—>B--—>C<--—D GetDirectionOf(A, B) is UPSTREAM GetDirectionOf(C, A) is DOWNSTREAM GetDirectionOf(D, A) is UNREACHABLE GetDirectionOf(A, D) is UNREACHABLE
Definition: graph.h:39
const std::string & value() const
Definition: graph.h:84
std::unordered_map< std::string, VerticeSet > AdjacencyList
Definition: graph.h:96
void set_src(const Vertice &v)
Definition: graph.h:79
bool operator!=(const Vertice &rhs) const
const std::string & value() const
Definition: graph.h:59
void set_value(const std::string &val)
Definition: graph.h:85
bool operator==(const Vertice &rhs) const
const Vertice & dst() const
Definition: graph.h:81
std::unordered_map< std::string, Vertice > VerticeSet
Definition: graph.h:95
Vertice(const std::string &val="")
void set_dst(const Vertice &v)
Definition: graph.h:82