Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
A few more sonar smells.
[simgrid.git] / src / kernel / actor / Simcall.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 SIMCALL_HPP
7 #define SIMCALL_HPP
8
9 #include "simgrid/forward.h"
10 #include "src/kernel/activity/ActivityImpl.hpp"
11 #include "xbt/utility.hpp"
12
13 /********************************* Simcalls *********************************/
14 namespace simgrid {
15 namespace kernel {
16 namespace actor {
17
18 /**
19  * @brief Represents a simcall to the kernel.
20  */
21 class Simcall {
22 public:
23   /** All possible simcalls. */
24   XBT_DECLARE_ENUM_CLASS(Type, NONE, RUN_ANSWERED, RUN_BLOCKING);
25
26   Type call_                                         = Type::NONE;
27   simgrid::kernel::actor::ActorImpl* issuer_         = nullptr;
28   simgrid::kernel::timer::Timer* timeout_cb_         = nullptr; // Callback to timeouts
29   simgrid::kernel::actor::SimcallObserver* observer_ = nullptr; // makes that simcall observable by the MC
30   unsigned int mc_max_consider_ =
31       0; // How many times this simcall should be used. If >1, this will be a fork in the state space.
32   std::function<void()> const* code_ = nullptr;
33
34   const char* get_cname() const;
35 };
36
37 } // namespace actor
38 } // namespace kernel
39 } // namespace simgrid
40
41 #endif