Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill Onelink now that NS3 does not use it anymore
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 8 Dec 2016 08:48:24 +0000 (09:48 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 8 Dec 2016 08:48:24 +0000 (09:48 +0100)
src/kernel/routing/AsImpl.cpp
src/kernel/routing/AsImpl.hpp
src/kernel/routing/AsRoutedGraph.cpp
src/kernel/routing/AsRoutedGraph.hpp
src/surf/surf_routing.hpp

index 86c782b..4ff5801 100644 (file)
@@ -41,17 +41,6 @@ namespace simgrid {
     return res;
   }
 
-  void AsImpl::getOneLinkRoutes(std::vector<Onelink*>* 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.
index c064172..8719b83 100644 (file)
@@ -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<surf::Link*> * links, double* latency);
 
-    virtual void getOneLinkRoutes(std::vector<Onelink*> * accumulator);
     virtual void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) = 0;
     enum class RoutingMode {
       unset = 0, /**< Undefined type                                   */
index aceae1a..7a96768 100644 (file)
@@ -74,33 +74,6 @@ AsRoutedGraph::AsRoutedGraph(As* father, const char* name) : AsImpl(father, name
 {
 }
 
-void AsRoutedGraph::getOneLinkRoutes(std::vector<Onelink*>* accumulator)
-{
-  sg_platf_route_cbarg_t route = xbt_new0(s_sg_platf_route_cbarg_t, 1);
-  route->link_list             = new std::vector<Link*>();
-
-  int table_size = static_cast<int>(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_){
index ad5daa7..e5967d6 100644 (file)
@@ -16,8 +16,6 @@ class XBT_PRIVATE AsRoutedGraph : public AsImpl {
 public:
   explicit AsRoutedGraph(As* father, const char* name);
 
-  void getOneLinkRoutes(std::vector<Onelink*>* 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:
index 888e3d0..878ffc9 100644 (file)
@@ -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<Link*> 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_ */