Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove unnecessary calls to c_str().
[simgrid.git] / src / kernel / routing / ClusterZone.cpp
index 5abe1c7..021eddd 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2009-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -17,7 +17,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster, surf, "Routing part of surf"
 namespace simgrid {
 namespace kernel {
 namespace routing {
-ClusterZone::ClusterZone(NetZone* father, std::string name) : NetZoneImpl(father, name)
+ClusterZone::ClusterZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel)
+    : NetZoneImpl(father, name, netmodel)
 {
 }
 
@@ -89,7 +90,7 @@ void ClusterZone::get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>
     new_xbt_graph_edge(graph, routerNode, backboneNode, edges);
   }
 
-  for (auto const& src : getVertices()) {
+  for (auto const& src : get_vertices()) {
     if (not src->is_router()) {
       xbt_node_t previous = new_xbt_graph_node(graph, src->get_cname(), nodes);
 
@@ -131,16 +132,16 @@ void ClusterZone::create_links_for_node(ClusterCreationArgs* cluster, int id, in
   link.policy    = cluster->sharing_policy;
   sg_platf_new_link(&link);
 
-  resource::LinkImpl* linkUp;
-  resource::LinkImpl* linkDown;
+  s4u::Link* linkUp;
+  s4u::Link* linkDown;
   if (link.policy == simgrid::s4u::Link::SharingPolicy::SPLITDUPLEX) {
-    linkUp   = resource::LinkImpl::by_name(link_id + "_UP");
-    linkDown = resource::LinkImpl::by_name(link_id + "_DOWN");
+    linkUp   = s4u::Link::by_name(link_id + "_UP");
+    linkDown = s4u::Link::by_name(link_id + "_DOWN");
   } else {
-    linkUp   = resource::LinkImpl::by_name(link_id);
+    linkUp   = s4u::Link::by_name(link_id);
     linkDown = linkUp;
   }
-  private_links_.insert({position, {linkUp, linkDown}});
+  private_links_.insert({position, {linkUp->get_impl(), linkDown->get_impl()}});
 }
 }
 }