X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3ce054415500e2f9b7ebf726c9f22446f5ec39f3..8cd2b8b1e341896e2b8c3e96eb3778316855504c:/examples/s4u/actions-comm/s4u-actions-comm.cpp diff --git a/examples/s4u/actions-comm/s4u-actions-comm.cpp b/examples/s4u/actions-comm/s4u-actions-comm.cpp index 2779185680..f620071304 100644 --- a/examples/s4u/actions-comm/s4u-actions-comm.cpp +++ b/examples/s4u/actions-comm/s4u-actions-comm.cpp @@ -85,7 +85,7 @@ 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 > 2, "Usage: %s platform_file deployment_file [action_files]\n" "\t# if all actions are in the same file\n" @@ -94,11 +94,11 @@ int main(int argc, char *argv[]) "\tExample: %s msg_platform.xml msg_deployment.xml ", argv[0], argv[0], argv[0]); - e->loadPlatform(argv[1]); - e->registerDefault(&simgrid::xbt::replay_runner); - e->registerFunction("p0"); - e->registerFunction("p1"); - e->loadDeployment(argv[2]); + e.loadPlatform(argv[1]); + e.registerDefault(&simgrid::xbt::replay_runner); + e.registerFunction("p0"); + e.registerFunction("p1"); + e.loadDeployment(argv[2]); /* Action registration */ xbt_replay_action_register("compute", Replayer::compute); @@ -109,15 +109,14 @@ int main(int argc, char *argv[]) simgrid::xbt::action_fs = new std::ifstream(argv[3], std::ifstream::in); } - e->run(); + e.run(); if (argv[3]) { delete simgrid::xbt::action_fs; simgrid::xbt::action_fs = nullptr; } - XBT_INFO("Simulation time %g", e->getClock()); + XBT_INFO("Simulation time %g", e.getClock()); - delete e; return 0; }