11 auto v = add_vertex(tn,
graph);
28 std::tie(e, b) = boost::add_edge(tv, hv, ep,
graph);
35 std::vector<Connection> ret;
36 auto vits = boost::vertices(
graph);
37 for (
auto v = vits.first; v != vits.second; ++v) {
39 auto eits = out_edges(*v,
graph);
41 if (eits.first == eits.second)
continue;
43 for (
auto e = eits.first;
e != eits.second; ++
e) {
49 ret.push_back(std::make_tuple(vp,hp,ep));
57 for (
auto conn : cfg) {
58 auto tail =
conn[
"tail"];
59 auto head =
conn[
"head"];
61 connect(get<std::string>(tail,
"type"), get<std::string>(tail,
"name"), get<int>(tail,
"port"),
62 get<std::string>(head,
"type"), get<std::string>(head,
"name"), get<int>(head,
"port"));
std::vector< Connection > connections()
void configure(const Configuration &cfg)
VertexPropertyMap vertex_property_map
boost::graph_traits< Graph >::edge_descriptor Edge
boost::graph_traits< Graph >::vertex_descriptor Vertex
Vertex get_add_vertex(const VertexProperty &tn)
Edge connect(const std::string &tail_type, const std::string &tail_name, int tail_port, const std::string &head_type, const std::string &head_name, int head_port)
Explicitly connect one edge.
Json::Value Configuration