Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove another now useless function from RoutingPlat
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 16 Nov 2016 00:54:20 +0000 (01:54 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 16 Nov 2016 00:54:20 +0000 (01:54 +0100)
src/surf/network_ns3.cpp
src/surf/surf_routing.cpp
src/surf/surf_routing.hpp

index 1acad86..8613239 100644 (file)
@@ -20,6 +20,7 @@
 #include "src/instr/instr_private.h" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
 
 #include "simgrid/s4u/As.hpp"
 #include "src/instr/instr_private.h" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
 
 #include "simgrid/s4u/As.hpp"
+#include "simgrid/s4u/engine.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ns3, surf, "Logging specific to the SURF network NS3 module");
 
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ns3, surf, "Logging specific to the SURF network NS3 module");
 
@@ -107,12 +108,14 @@ static void create_ns3_topology(void)
   xbt_dynar_shrink(IPV4addr,0);
 
   //get the onelinks from the parsed platform
   xbt_dynar_shrink(IPV4addr,0);
 
   //get the onelinks from the parsed platform
-  std::vector<simgrid::kernel::routing::Onelink*>* onelink_routes = routing_platf->getOneLinkRoutes();
+  std::vector<simgrid::kernel::routing::Onelink*> onelink_routes;
+  static_cast<simgrid::kernel::routing::AsImpl*>(simgrid::s4u::Engine::instance()->rootAs())
+      ->getOneLinkRoutes(&onelink_routes);
 
   std::unordered_set<simgrid::surf::LinkNS3*> already_seen = std::unordered_set<simgrid::surf::LinkNS3*>();
 
 
   std::unordered_set<simgrid::surf::LinkNS3*> already_seen = std::unordered_set<simgrid::surf::LinkNS3*>();
 
-  XBT_DEBUG("There is %ld one-link routes", onelink_routes->size());
-  for (simgrid::kernel::routing::Onelink* onelink : *onelink_routes) {
+  XBT_DEBUG("There is %ld one-link routes", onelink_routes.size());
+  for (simgrid::kernel::routing::Onelink* onelink : onelink_routes) {
     const char* src              = onelink->src_->name().c_str();
     const char* dst              = onelink->dst_->name().c_str();
     simgrid::surf::LinkNS3 *link = static_cast<simgrid::surf::LinkNS3 *>(onelink->link_);
     const char* src              = onelink->src_->name().c_str();
     const char* dst              = onelink->dst_->name().c_str();
     simgrid::surf::LinkNS3 *link = static_cast<simgrid::surf::LinkNS3 *>(onelink->link_);
index d4cd3d5..e23d601 100644 (file)
@@ -100,13 +100,6 @@ void RoutingPlatf::getRouteAndLatency(NetCard *src, NetCard *dst, std::vector<Li
   AsImpl::getRouteRecursive(src, dst, route, latency);
 }
 
   AsImpl::getRouteRecursive(src, dst, route, latency);
 }
 
-std::vector<Onelink*>* RoutingPlatf::getOneLinkRoutes()
-{
-  std::vector<Onelink*>* res = new std::vector<Onelink*>();
-  root_->getOneLinkRoutes(res);
-  return res;
-}
-
 }}}
 
 /* ************************************************************************** */
 }}}
 
 /* ************************************************************************** */
index cd1db49..e18ccc5 100644 (file)
@@ -108,7 +108,6 @@ public:
   explicit RoutingPlatf();
   ~RoutingPlatf();
   AsImpl *root_ = nullptr;
   explicit RoutingPlatf();
   ~RoutingPlatf();
   AsImpl *root_ = nullptr;
-  std::vector<Onelink*>* getOneLinkRoutes();
   void getRouteAndLatency(NetCard *src, NetCard *dst, std::vector<Link*> * links, double *latency);
 };
 
   void getRouteAndLatency(NetCard *src, NetCard *dst, std::vector<Link*> * links, double *latency);
 };