1 /* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #ifndef SIMIX_PRIVATE_HPP
7 #define SIMIX_PRIVATE_HPP
9 #include "simgrid/s4u/Actor.hpp"
10 #include "src/kernel/actor/ActorImpl.hpp"
11 #include "src/kernel/context/Context.hpp"
13 /********************************** Simix Global ******************************/
19 kernel::context::ContextFactory* context_factory_ = nullptr;
20 kernel::actor::ActorImpl* maestro_ = nullptr;
23 bool is_maestro(kernel::actor::ActorImpl* actor) const { return actor == maestro_; }
24 void set_maestro(kernel::actor::ActorImpl* actor) { maestro_ = actor; }
25 kernel::actor::ActorImpl* get_maestro() const { return maestro_; }
26 void destroy_maestro()
32 kernel::context::ContextFactory* get_context_factory() const { return context_factory_; }
33 void set_context_factory(kernel::context::ContextFactory* factory) { context_factory_ = factory; }
34 bool has_context_factory() const { return context_factory_ != nullptr; }
35 void destroy_context_factory()
37 delete context_factory_;
38 context_factory_ = nullptr;
44 XBT_PUBLIC_DATA std::unique_ptr<simgrid::simix::Global> simix_global;
46 XBT_PUBLIC void SIMIX_clean();