Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
reduce the visibility of popping_private
[simgrid.git] / src / simix / popping_private.hpp
1 /* Copyright (c) 2007-2022. 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 SG_POPPING_PRIVATE_HPP
7 #define SG_POPPING_PRIVATE_HPP
8
9 #include "simgrid/forward.h"
10 #include "src/kernel/activity/ActivityImpl.hpp"
11
12 #include <array>
13 #include <boost/intrusive_ptr.hpp>
14
15 /********************************* Simcalls *********************************/
16 namespace simgrid {
17 namespace simix {
18 /** All possible simcalls. */
19 enum class Simcall {
20   NONE,
21   RUN_KERNEL,
22   RUN_BLOCKING,
23 };
24 constexpr int NUM_SIMCALLS = 3;
25 } // namespace simix
26 } // namespace simgrid
27
28
29 /**
30  * @brief Represents a simcall to the kernel.
31  */
32 struct s_smx_simcall {
33   simgrid::simix::Simcall call_                      = simgrid::simix::Simcall::NONE;
34   smx_actor_t issuer_                                = nullptr;
35   simgrid::kernel::timer::Timer* timeout_cb_         = nullptr; // Callback to timeouts
36   simgrid::kernel::actor::SimcallObserver* observer_ = nullptr; // makes that simcall observable by the MC
37   unsigned int mc_max_consider_ =
38       0; // How many times this simcall should be used. If >1, this will be a fork in the state space.
39   std::function<void()> const* code_      = nullptr;
40 };
41
42 /******************************** General *************************************/
43
44 XBT_PRIVATE const char* SIMIX_simcall_name(const s_smx_simcall& simcall);
45
46 #endif