X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8735a101c4a502473ba7381e88aec514ebe1b828..3a15a2893fa0aa6b626063cb446cd1fc6b0088d8:/src/kernel/routing/DijkstraZone.cpp diff --git a/src/kernel/routing/DijkstraZone.cpp b/src/kernel/routing/DijkstraZone.cpp index 5471809983..6270976eae 100644 --- a/src/kernel/routing/DijkstraZone.cpp +++ b/src/kernel/routing/DijkstraZone.cpp @@ -27,8 +27,6 @@ public: int graph_id_ = -1; /* used for caching internal graph id's */ }; -DijkstraZone::DijkstraZone(const std::string& name, bool cached) : RoutedZone(name), cached_(cached) {} - void DijkstraZone::route_graph_delete(xbt_graph_t g) { xbt_graph_free_graph( @@ -42,7 +40,7 @@ void DijkstraZone::do_seal() xbt_node_t node = nullptr; /* Add the loopback if needed */ - if (get_network_model()->loopback_ && hierarchy_ == RoutingMode::base) { + if (get_network_model()->loopback_ && get_hierarchy() == RoutingMode::base) { xbt_dynar_foreach (xbt_graph_get_nodes(route_graph_.get()), cursor, node) { bool found = false; xbt_edge_t edge = nullptr; @@ -189,7 +187,8 @@ void DijkstraZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationAr if (v == dst_node_id) first_gw = gw_dst; - if (hierarchy_ == RoutingMode::recursive && v != dst_node_id && gw_dst->get_name() != prev_gw_src->get_name()) { + if (get_hierarchy() == RoutingMode::recursive && v != dst_node_id && + gw_dst->get_name() != prev_gw_src->get_name()) { std::vector e_route_as_to_as; NetPoint* gw_dst_net_elm = nullptr; @@ -211,7 +210,7 @@ void DijkstraZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationAr } } - if (hierarchy_ == RoutingMode::recursive) { + if (get_hierarchy() == RoutingMode::recursive) { route->gw_src = gw_src; route->gw_dst = first_gw; } @@ -221,14 +220,14 @@ void DijkstraZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationAr } void DijkstraZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, - std::vector& link_list, bool symmetrical) + const std::vector& link_list, bool symmetrical) { add_route_check_params(src, dst, gw_src, gw_dst, link_list, symmetrical); - new_edge(src->id(), dst->id(), new_extended_route(hierarchy_, gw_src, gw_dst, link_list, true)); + new_edge(src->id(), dst->id(), new_extended_route(get_hierarchy(), gw_src, gw_dst, link_list, true)); if (symmetrical) - new_edge(dst->id(), src->id(), new_extended_route(hierarchy_, gw_dst, gw_src, link_list, false)); + new_edge(dst->id(), src->id(), new_extended_route(get_hierarchy(), gw_dst, gw_src, link_list, false)); } void DijkstraZone::new_edge(int src_id, int dst_id, RouteCreationArgs* route) @@ -260,4 +259,12 @@ void DijkstraZone::new_edge(int src_id, int dst_id, RouteCreationArgs* route) } } // namespace routing } // namespace kernel + +namespace s4u { +NetZone* create_dijkstra_zone(const std::string& name, bool cache) +{ + return (new kernel::routing::DijkstraZone(name, cache))->get_iface(); +} +} // namespace s4u + } // namespace simgrid