Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
8e7869fdd529ef48588b7e5f8f325a8882119378
[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 namespace simgrid::kernel::actor {
14
15 /**
16  * @brief Represents a simcall to the kernel.
17  */
18 class Simcall {
19 public:
20   /** All possible simcalls. */
21   XBT_DECLARE_ENUM_CLASS(Type, NONE, RUN_ANSWERED, RUN_BLOCKING);
22
23   Type call_                                         = Type::NONE;
24   simgrid::kernel::actor::ActorImpl* issuer_         = nullptr;
25   simgrid::kernel::timer::Timer* timeout_cb_         = nullptr; // Callback to timeouts
26   simgrid::kernel::actor::SimcallObserver* observer_ = nullptr; // makes that simcall observable by the MC
27   std::function<void()> const* code_ = nullptr;
28
29   const char* get_cname() const;
30 };
31
32 } // namespace simgrid::kernel::actor
33
34 #endif