Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
modernize SIMIX_comm_set_copy_data_callback
[simgrid.git] / src / simix / smx_private.hpp
index a57df811004df17f8f5432d4486fa63d2c609140..f114e5ffefcc5b8516bcefebe32a66fcc942e594 100644 (file)
@@ -17,9 +17,18 @@ namespace simix {
 
 class Global {
   kernel::context::ContextFactory* context_factory_ = nullptr;
+  kernel::actor::ActorImpl* maestro_                = nullptr;
 
 public:
-  kernel::actor::ActorImpl* maestro_ = nullptr;
+  bool is_maestro(const kernel::actor::ActorImpl* actor) const { return actor == maestro_; }
+  void set_maestro(kernel::actor::ActorImpl* actor) { maestro_ = actor; }
+  kernel::actor::ActorImpl* get_maestro() const { return maestro_; }
+  void destroy_maestro()
+  {
+    delete maestro_;
+    maestro_ = nullptr;
+  }
+
   kernel::context::ContextFactory* get_context_factory() const { return context_factory_; }
   void set_context_factory(kernel::context::ContextFactory* factory) { context_factory_ = factory; }
   bool has_context_factory() const { return context_factory_ != nullptr; }