Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
say bye to simgrid::surf namespace
[simgrid.git] / src / surf / sg_platf.cpp
index 0838631..2f89c3a 100644 (file)
@@ -3,27 +3,29 @@
 /* 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. */
 
-#include "simgrid/Exception.hpp"
-#include "simgrid/kernel/routing/DijkstraZone.hpp"
-#include "simgrid/kernel/routing/DragonflyZone.hpp"
-#include "simgrid/kernel/routing/EmptyZone.hpp"
-#include "simgrid/kernel/routing/FatTreeZone.hpp"
-#include "simgrid/kernel/routing/FloydZone.hpp"
-#include "simgrid/kernel/routing/FullZone.hpp"
-#include "simgrid/kernel/routing/NetPoint.hpp"
-#include "simgrid/kernel/routing/NetZoneImpl.hpp"
-#include "simgrid/kernel/routing/TorusZone.hpp"
-#include "simgrid/kernel/routing/VivaldiZone.hpp"
-#include "simgrid/kernel/routing/WifiZone.hpp"
-#include "simgrid/s4u/Engine.hpp"
-#include "simgrid/s4u/NetZone.hpp"
-#include "src/include/simgrid/sg_config.hpp"
-#include "src/include/surf/surf.hpp"
+#include <simgrid/Exception.hpp>
+#include <simgrid/kernel/routing/DijkstraZone.hpp>
+#include <simgrid/kernel/routing/DragonflyZone.hpp>
+#include <simgrid/kernel/routing/EmptyZone.hpp>
+#include <simgrid/kernel/routing/FatTreeZone.hpp>
+#include <simgrid/kernel/routing/FloydZone.hpp>
+#include <simgrid/kernel/routing/FullZone.hpp>
+#include <simgrid/kernel/routing/NetPoint.hpp>
+#include <simgrid/kernel/routing/NetZoneImpl.hpp>
+#include <simgrid/kernel/routing/TorusZone.hpp>
+#include <simgrid/kernel/routing/VivaldiZone.hpp>
+#include <simgrid/kernel/routing/WifiZone.hpp>
+#include <simgrid/s4u/Engine.hpp>
+#include <simgrid/s4u/NetZone.hpp>
+
+#include "simgrid/sg_config.hpp"
 #include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/resource/DiskImpl.hpp"
 #include "src/kernel/resource/profile/Profile.hpp"
 #include "src/surf/HostImpl.hpp"
+#include "src/surf/xml/platf.hpp"
 #include "src/surf/xml/platf_private.hpp"
+#include "surf/surf.hpp"
 
 #include <algorithm>
 #include <string>
@@ -377,11 +379,12 @@ static void sg_platf_build_hostlink(simgrid::kernel::routing::StarZone* zone,
                                     const simgrid::kernel::routing::HostLinkCreationArgs* hostlink,
                                     const simgrid::s4u::Link* backbone)
 {
-  simgrid::kernel::routing::NetPoint* netpoint = simgrid::s4u::Host::by_name(hostlink->id)->get_netpoint();
+  const auto engine = simgrid::s4u::Engine::get_instance();
+  auto netpoint     = engine->host_by_name(hostlink->id)->get_netpoint();
   xbt_assert(netpoint, "Host '%s' not found!", hostlink->id.c_str());
 
-  const simgrid::s4u::Link* linkUp   = simgrid::s4u::Link::by_name_or_null(hostlink->link_up);
-  const simgrid::s4u::Link* linkDown = simgrid::s4u::Link::by_name_or_null(hostlink->link_down);
+  const auto linkUp   = engine->link_by_name_or_null(hostlink->link_up);
+  const auto linkDown = engine->link_by_name_or_null(hostlink->link_down);
 
   xbt_assert(linkUp, "Link '%s' not found!", hostlink->link_up.c_str());
   xbt_assert(linkDown, "Link '%s' not found!", hostlink->link_down.c_str());
@@ -452,7 +455,7 @@ void sg_platf_new_bypass_route(simgrid::kernel::routing::RouteCreationArgs* rout
 
 void sg_platf_new_actor(simgrid::kernel::routing::ActorCreationArgs* actor)
 {
-  auto* engine   = simgrid::s4u::Engine::get_instance();
+  const auto* engine = simgrid::s4u::Engine::get_instance();
   sg_host_t host = sg_host_by_name(actor->host);
   if (not host) {
     // The requested host does not exist. Do a nice message to the user