Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove useless includes for xbt/str.h.
[simgrid.git] / examples / s4u / app-token-ring / s4u-app-token-ring.cpp
index a5c3d7f..7f242e4 100644 (file)
@@ -3,7 +3,6 @@
 /* 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 "xbt/str.h"
 #include <simgrid/s4u.hpp>
 #include <algorithm>
 #include <string>
@@ -55,22 +54,21 @@ public:
 
 int main(int argc, char** argv)
 {
-  simgrid::s4u::Engine* e = new simgrid::s4u::Engine(&argc, argv);
+  simgrid::s4u::Engine e(&argc, argv);
   xbt_assert(argc > 1, "Usage: %s platform.xml\n", argv[0]);
-  e->loadPlatform(argv[1]);
+  e.loadPlatform(argv[1]);
 
-  XBT_INFO("Number of hosts '%zu'", e->getHostCount());
+  XBT_INFO("Number of hosts '%zu'", e.getHostCount());
   int id = 0;
   std::vector<simgrid::s4u::Host*> list;
-  e->getHostList(&list);
+  e.getHostList(&list);
   for (auto const& host : list) {
     /* - Give a unique rank to each host and create a @ref relay_runner process on each */
     simgrid::s4u::Actor::createActor((std::to_string(id)).c_str(), host, RelayRunner());
     id++;
   }
-  e->run();
-  XBT_INFO("Simulation time %g", e->getClock());
+  e.run();
+  XBT_INFO("Simulation time %g", e.getClock());
 
-  delete e;
   return 0;
 }