Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix the syntax in the sonar configuration (fix #126)
[simgrid.git] / src / s4u / s4u_as.cpp
index 6a6f4ca..4700b23 100644 (file)
@@ -82,24 +82,24 @@ namespace simgrid {
       xbt_assert(!e_route->link_list->empty(), "Bypass route between %s@%s and %s@%s cannot be empty.",
                  e_route->src->name().c_str(), e_route->gw_src->name().c_str(), e_route->dst->name().c_str(),
                  e_route->gw_dst->name().c_str());
-      xbt_assert(bypassRoutes_.find({e_route->src->name(), e_route->dst->name()}) == bypassRoutes_.end(),
+      xbt_assert(bypassRoutes_.find({e_route->src, e_route->dst}) == bypassRoutes_.end(),
                  "The bypass route between %s@%s and %s@%s already exists.", e_route->src->name().c_str(),
                  e_route->gw_src->name().c_str(), e_route->dst->name().c_str(), e_route->gw_dst->name().c_str());
     } else {
       XBT_DEBUG("Load bypassRoute from %s to %s", e_route->src->name().c_str(), e_route->dst->name().c_str());
       xbt_assert(!e_route->link_list->empty(), "Bypass route between %s and %s cannot be empty.",
                  e_route->src->name().c_str(), e_route->dst->name().c_str());
-      xbt_assert(bypassRoutes_.find({e_route->src->name(), e_route->dst->name()}) == bypassRoutes_.end(),
+      xbt_assert(bypassRoutes_.find({e_route->src, e_route->dst}) == bypassRoutes_.end(),
                  "The bypass route between %s and %s already exists.", e_route->src->name().c_str(),
                  e_route->dst->name().c_str());
     }
 
     /* Build a copy that will be stored in the dict */
-    std::vector<surf::Link*>* newRoute = new std::vector<surf::Link*>();
+    kernel::routing::AsRoute* newRoute = new kernel::routing::AsRoute(e_route->gw_src, e_route->gw_dst);
     for (auto link : *e_route->link_list)
-      newRoute->push_back(link);
+      newRoute->links.push_back(link);
 
     /* Store it */
-    bypassRoutes_.insert({{e_route->src->name(), e_route->dst->name()}, newRoute});
+    bypassRoutes_.insert({{e_route->src, e_route->dst}, newRoute});
   }
 }  }; // namespace simgrid::s4u