From 8326486153d4a85ad17b2125fe60108a3d0870e8 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Wed, 16 Nov 2016 01:54:20 +0100 Subject: [PATCH] remove another now useless function from RoutingPlat --- src/surf/network_ns3.cpp | 9 ++++++--- src/surf/surf_routing.cpp | 7 ------- src/surf/surf_routing.hpp | 1 - 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index 1acad86da7..8613239a2f 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -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 "simgrid/s4u/engine.hpp" 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 - std::vector* onelink_routes = routing_platf->getOneLinkRoutes(); + std::vector onelink_routes; + static_cast(simgrid::s4u::Engine::instance()->rootAs()) + ->getOneLinkRoutes(&onelink_routes); std::unordered_set already_seen = std::unordered_set(); - 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(onelink->link_); diff --git a/src/surf/surf_routing.cpp b/src/surf/surf_routing.cpp index d4cd3d5273..e23d601e6a 100644 --- a/src/surf/surf_routing.cpp +++ b/src/surf/surf_routing.cpp @@ -100,13 +100,6 @@ void RoutingPlatf::getRouteAndLatency(NetCard *src, NetCard *dst, std::vector
  • * RoutingPlatf::getOneLinkRoutes() -{ - std::vector* res = new std::vector(); - root_->getOneLinkRoutes(res); - return res; -} - }}} /* ************************************************************************** */ diff --git a/src/surf/surf_routing.hpp b/src/surf/surf_routing.hpp index cd1db49b61..e18ccc5b29 100644 --- a/src/surf/surf_routing.hpp +++ b/src/surf/surf_routing.hpp @@ -108,7 +108,6 @@ public: explicit RoutingPlatf(); ~RoutingPlatf(); AsImpl *root_ = nullptr; - std::vector* getOneLinkRoutes(); void getRouteAndLatency(NetCard *src, NetCard *dst, std::vector * links, double *latency); }; -- 2.20.1