Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fewer explicit news are fewer possible leaks
[simgrid.git] / examples / s4u / app-masterworker / s4u-app-masterworker.cpp
index c0ce006..d360480 100644 (file)
@@ -85,20 +85,19 @@ 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\n"
                        "\tExample: %s msg_platform.xml msg_deployment.xml\n",
              argv[0], argv[0]);
 
-  e->loadPlatform(argv[1]);              /** - Load the platform description */
-  e->registerFunction<Master>("master");
-  e->registerFunction<Worker>("worker"); /** - Register the function to be executed by the processes */
-  e->loadDeployment(argv[2]);            /** - Deploy the application */
+  e.loadPlatform(argv[1]); /** - Load the platform description */
+  e.registerFunction<Master>("master");
+  e.registerFunction<Worker>("worker"); /** - Register the function to be executed by the processes */
+  e.loadDeployment(argv[2]);            /** - Deploy the application */
 
-  e->run(); /** - Run the simulation */
+  e.run(); /** - Run the simulation */
 
-  XBT_INFO("Simulation time %g", e->getClock());
+  XBT_INFO("Simulation time %g", e.getClock());
 
-  delete e;
   return 0;
 }