Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
do not use RouteCreationArgs outside of XML parsing
[simgrid.git] / src / kernel / routing / FloydZone.cpp
index 5e109f3..593810d 100644 (file)
@@ -6,7 +6,6 @@
 #include "simgrid/kernel/routing/FloydZone.hpp"
 #include "simgrid/kernel/routing/NetPoint.hpp"
 #include "src/surf/network_interface.hpp"
-#include "src/surf/xml/platf_private.hpp"
 #include "surf/surf.hpp"
 #include "xbt/string.hpp"
 
@@ -40,14 +39,14 @@ void FloydZone::init_tables(unsigned int table_size)
   }
 }
 
-void FloydZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat)
+void FloydZone::get_local_route(NetPoint* src, NetPoint* dst, Route* route, double* lat)
 {
   unsigned int table_size = get_table_size();
 
   get_route_check_params(src, dst);
 
   /* create a result route */
-  std::vector<RouteCreationArgs*> route_stack;
+  std::vector<Route*> route_stack;
   unsigned int cur = dst->id();
   do {
     int pred = TO_FLOYD_PRED(src->id(), cur);
@@ -58,37 +57,37 @@ void FloydZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs*
   } while (cur != src->id());
 
   if (get_hierarchy() == RoutingMode::recursive) {
-    route->gw_src = route_stack.back()->gw_src;
-    route->gw_dst = route_stack.front()->gw_dst;
+    route->gw_src_ = route_stack.back()->gw_src_;
+    route->gw_dst_ = route_stack.front()->gw_dst_;
   }
 
   NetPoint* prev_dst_gw = nullptr;
   while (not route_stack.empty()) {
-    const RouteCreationArgs* e_route = route_stack.back();
+    const Route* e_route = route_stack.back();
     route_stack.pop_back();
     if (get_hierarchy() == RoutingMode::recursive && prev_dst_gw != nullptr &&
-        prev_dst_gw->get_cname() != e_route->gw_src->get_cname()) {
-      get_global_route(prev_dst_gw, e_route->gw_src, route->link_list, lat);
+        prev_dst_gw->get_cname() != e_route->gw_src_->get_cname()) {
+      get_global_route(prev_dst_gw, e_route->gw_src_, route->link_list_, lat);
     }
 
-    for (auto const& link : e_route->link_list) {
-      route->link_list.push_back(link);
+    for (auto const& link : e_route->link_list_) {
+      route->link_list_.push_back(link);
       if (lat)
         *lat += link->get_latency();
     }
 
-    prev_dst_gw = e_route->gw_dst;
+    prev_dst_gw = e_route->gw_dst_;
   }
 }
 
 void FloydZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
-                          const std::vector<resource::LinkImpl*>& link_list, bool symmetrical)
+                          const std::vector<resource::LinkImpl*>& link_list_, bool symmetrical)
 {
   /* set the size of table routing */
   unsigned int table_size = get_table_size();
   init_tables(table_size);
 
-  add_route_check_params(src, dst, gw_src, gw_dst, link_list, symmetrical);
+  add_route_check_params(src, dst, gw_src, gw_dst, link_list_, symmetrical);
 
   /* Check that the route does not already exist */
   if (gw_dst && gw_src) // netzone route (to adapt the error message, if any)
@@ -100,9 +99,9 @@ void FloydZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoi
                "The route between %s and %s already exists (Rq: routes are symmetrical by default).", src->get_cname(),
                dst->get_cname());
 
-  TO_FLOYD_LINK(src->id(), dst->id()) = new_extended_route(get_hierarchy(), gw_src, gw_dst, link_list, true);
+  TO_FLOYD_LINK(src->id(), dst->id()) = new_extended_route(get_hierarchy(), gw_src, gw_dst, link_list_, true);
   TO_FLOYD_PRED(src->id(), dst->id()) = src->id();
-  TO_FLOYD_COST(src->id(), dst->id()) = (TO_FLOYD_LINK(src->id(), dst->id()))->link_list.size();
+  TO_FLOYD_COST(src->id(), dst->id()) = (TO_FLOYD_LINK(src->id(), dst->id()))->link_list_.size();
 
   if (symmetrical) {
     if (gw_dst && gw_src) // netzone route (to adapt the error message, if any)
@@ -127,10 +126,10 @@ void FloydZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoi
       XBT_DEBUG("Load NetzoneRoute from \"%s(%s)\" to \"%s(%s)\"", dst->get_cname(), gw_src->get_cname(),
                 src->get_cname(), gw_dst->get_cname());
 
-    TO_FLOYD_LINK(dst->id(), src->id()) = new_extended_route(get_hierarchy(), gw_src, gw_dst, link_list, false);
+    TO_FLOYD_LINK(dst->id(), src->id()) = new_extended_route(get_hierarchy(), gw_src, gw_dst, link_list_, false);
     TO_FLOYD_PRED(dst->id(), src->id()) = dst->id();
     TO_FLOYD_COST(dst->id(), src->id()) =
-        (TO_FLOYD_LINK(dst->id(), src->id()))->link_list.size(); /* count of links, old model assume 1 */
+        (TO_FLOYD_LINK(dst->id(), src->id()))->link_list_.size(); /* count of links, old model assume 1 */
   }
 }
 
@@ -143,10 +142,10 @@ void FloydZone::do_seal()
   /* Add the loopback if needed */
   if (get_network_model()->loopback_ && get_hierarchy() == RoutingMode::base) {
     for (unsigned int i = 0; i < table_size; i++) {
-      RouteCreationArgs* route = TO_FLOYD_LINK(i, i);
+      Route* route = TO_FLOYD_LINK(i, i);
       if (not route) {
-        route = new RouteCreationArgs();
-        route->link_list.push_back(get_network_model()->loopback_);
+        route = new Route();
+        route->link_list_.push_back(get_network_model()->loopback_);
         TO_FLOYD_LINK(i, i) = route;
         TO_FLOYD_PRED(i, i) = i;
         TO_FLOYD_COST(i, i) = 1;