]> AND Public Git Repository - simgrid.git/blobdiff - src/simdag/simdag_private.hpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
More consistency in resource creation/destruction
[simgrid.git] / src / simdag / simdag_private.hpp
index 734cb6ee80ab581b41ea1c410e28b8b1f69d65cb..bb06103925c6070ffe8ea7becc5be0b8c468ab95 100644 (file)
@@ -1,8 +1,9 @@
-/* Copyright (c) 2006-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2021. 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. */
 
+#include "simgrid/s4u/Engine.hpp"
 #include "simgrid/simdag.h"
 #include "surf/surf.hpp"
 #include <set>
@@ -19,18 +20,20 @@ namespace simgrid{
 namespace sd{
 class Global {
 public:
+  explicit Global(int* argc, char** argv) : engine_(new simgrid::s4u::Engine(argc, argv)) {}
   bool watch_point_reached = false; /* has a task just reached a watch point? */
   std::set<SD_task_t> initial_tasks;
   std::set<SD_task_t> runnable_tasks;
   std::set<SD_task_t> completed_tasks;
   std::set<SD_task_t> return_set;
+  s4u::Engine* engine_;
 };
 
 std::set<SD_task_t>* simulate (double how_long);
 }
 }
 
-extern XBT_PRIVATE simgrid::sd::Global *sd_global;
+extern XBT_PRIVATE std::unique_ptr<simgrid::sd::Global> sd_global;
 
 /* Task */
 struct s_SD_task_t {