Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
a57df811004df17f8f5432d4486fa63d2c609140
[simgrid.git] / src / simix / smx_private.hpp
1 /* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved.          */
2
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. */
5
6 #ifndef SIMIX_PRIVATE_HPP
7 #define SIMIX_PRIVATE_HPP
8
9 #include "simgrid/s4u/Actor.hpp"
10 #include "src/kernel/actor/ActorImpl.hpp"
11 #include "src/kernel/context/Context.hpp"
12
13 /********************************** Simix Global ******************************/
14
15 namespace simgrid {
16 namespace simix {
17
18 class Global {
19   kernel::context::ContextFactory* context_factory_ = nullptr;
20
21 public:
22   kernel::actor::ActorImpl* maestro_ = nullptr;
23   kernel::context::ContextFactory* get_context_factory() const { return context_factory_; }
24   void set_context_factory(kernel::context::ContextFactory* factory) { context_factory_ = factory; }
25   bool has_context_factory() const { return context_factory_ != nullptr; }
26   void destroy_context_factory()
27   {
28     delete context_factory_;
29     context_factory_ = nullptr;
30   }
31 };
32 }
33 }
34
35 XBT_PUBLIC_DATA std::unique_ptr<simgrid::simix::Global> simix_global;
36
37 XBT_PUBLIC void SIMIX_clean();
38
39 #endif