From: Martin Quinson Date: Thu, 8 Dec 2016 08:48:24 +0000 (+0100) Subject: Kill Onelink now that NS3 does not use it anymore X-Git-Tag: v3_14~96 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/118d3f4ca3b1f74eb632dec688ca5c7dfab7f1ba?hp=390ee57ed79bf7577c2bce6df6a25aba57ff476e Kill Onelink now that NS3 does not use it anymore --- diff --git a/src/kernel/routing/AsImpl.cpp b/src/kernel/routing/AsImpl.cpp index 86c782b7b6..4ff5801d07 100644 --- a/src/kernel/routing/AsImpl.cpp +++ b/src/kernel/routing/AsImpl.cpp @@ -41,17 +41,6 @@ namespace simgrid { return res; } - void AsImpl::getOneLinkRoutes(std::vector* accumulator) - { - // recursing only. I have no route myself :) - char* key; - xbt_dict_cursor_t cursor = nullptr; - AsImpl* rc_child; - xbt_dict_foreach (children(), cursor, key, rc_child) { - rc_child->getOneLinkRoutes(accumulator); - } - } - /** @brief Get the common ancestor and its first children in each line leading to src and dst * * In the recursive case, this sets common_ancestor, src_ancestor and dst_ancestor are set as follows. diff --git a/src/kernel/routing/AsImpl.hpp b/src/kernel/routing/AsImpl.hpp index c064172b26..8719b8337e 100644 --- a/src/kernel/routing/AsImpl.hpp +++ b/src/kernel/routing/AsImpl.hpp @@ -16,8 +16,6 @@ namespace simgrid { namespace kernel { namespace routing { - class Onelink; - /** @brief Autonomous Systems * * An AS is a network container, in charge of routing information between elements (hosts) and to the nearby ASes. @@ -80,7 +78,6 @@ namespace routing { static void getGlobalRoute(routing::NetCard * src, routing::NetCard * dst, /* OUT */ std::vector * links, double* latency); - virtual void getOneLinkRoutes(std::vector * accumulator); virtual void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) = 0; enum class RoutingMode { unset = 0, /**< Undefined type */ diff --git a/src/kernel/routing/AsRoutedGraph.cpp b/src/kernel/routing/AsRoutedGraph.cpp index aceae1afcf..7a9676830b 100644 --- a/src/kernel/routing/AsRoutedGraph.cpp +++ b/src/kernel/routing/AsRoutedGraph.cpp @@ -74,33 +74,6 @@ AsRoutedGraph::AsRoutedGraph(As* father, const char* name) : AsImpl(father, name { } -void AsRoutedGraph::getOneLinkRoutes(std::vector* accumulator) -{ - sg_platf_route_cbarg_t route = xbt_new0(s_sg_platf_route_cbarg_t, 1); - route->link_list = new std::vector(); - - int table_size = static_cast(vertices_.size()); - for (int src = 0; src < table_size; src++) { - for (int dst = 0; dst < table_size; dst++) { - route->link_list->clear(); - NetCard* src_elm = vertices_.at(src); - NetCard* dst_elm = vertices_.at(dst); - getLocalRoute(src_elm, dst_elm, route, nullptr); - - if (route->link_list->size() == 1) { - Link* link = route->link_list->at(0); - if (hierarchy_ == RoutingMode::base) - accumulator->push_back(new Onelink(link, src_elm, dst_elm)); - else if (hierarchy_ == RoutingMode::recursive) - accumulator->push_back(new Onelink(link, route->gw_src, route->gw_dst)); - else - accumulator->push_back(new Onelink(link, nullptr, nullptr)); - } - } - } - AsImpl::getOneLinkRoutes(accumulator); // Recursivly call this function on all my childs too -} - void AsRoutedGraph::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) { for (auto my_src: vertices_){ diff --git a/src/kernel/routing/AsRoutedGraph.hpp b/src/kernel/routing/AsRoutedGraph.hpp index ad5daa7248..e5967d68c1 100644 --- a/src/kernel/routing/AsRoutedGraph.hpp +++ b/src/kernel/routing/AsRoutedGraph.hpp @@ -16,8 +16,6 @@ class XBT_PRIVATE AsRoutedGraph : public AsImpl { public: explicit AsRoutedGraph(As* father, const char* name); - void getOneLinkRoutes(std::vector* accumulator) override; - void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) override; virtual sg_platf_route_cbarg_t newExtendedRoute(RoutingMode hierarchy, sg_platf_route_cbarg_t routearg, int change_order); protected: diff --git a/src/surf/surf_routing.hpp b/src/surf/surf_routing.hpp index 888e3d01a0..878ffc9915 100644 --- a/src/surf/surf_routing.hpp +++ b/src/surf/surf_routing.hpp @@ -30,8 +30,6 @@ namespace routing { * Classes * ***********/ -class XBT_PRIVATE Onelink; - class AsRoute { public: explicit AsRoute(NetCard* gwSrc, NetCard* gwDst) : gw_src(gwSrc), gw_dst(gwDst) {} @@ -40,17 +38,6 @@ public: std::vector links; }; -/** @ingroup SURF_routing_interface - * @brief Link of length 1, alongside with its source and destination. This is mainly useful in the ns3 bindings - */ -class Onelink { -public: - Onelink(Link* link, NetCard* src, NetCard* dst) : src_(src), dst_(dst), link_(link) {} - NetCard* src_; - NetCard* dst_; - Link* link_; -}; - }}} #endif /* NETWORK_ROUTING_HPP_ */