Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix builds with/without MC and with/without clang (hopefully)
[simgrid.git] / src / mc / TransitionComm.hpp
1 /* Copyright (c) 2015-2022. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef SIMGRID_MC_TRANSITION_COMM_HPP
8 #define SIMGRID_MC_TRANSITION_COMM_HPP
9
10 #include "simgrid/forward.h" // aid_t
11 #include "src/kernel/actor/SimcallObserver.hpp"
12 #include <string>
13
14 namespace simgrid {
15 namespace mc {
16
17 class CommSendTransition;
18 class CommRecvTransition;
19
20 class CommWaitTransition : public Transition {
21   bool timeout_;
22   void* comm_;
23   aid_t sender_;
24   aid_t receiver_;
25   unsigned mbox_;
26   void* src_buff_;
27   void* dst_buff_;
28   size_t size_;
29   friend CommSendTransition;
30   friend CommRecvTransition;
31
32 public:
33   CommWaitTransition(aid_t issuer, int times_considered, char* buffer);
34   std::string to_string(bool verbose) override;
35   bool depends(const Transition* other) const override;
36 };
37
38 class CommRecvTransition : public Transition {
39   unsigned mbox_;
40   void* dst_buff_;
41
42 public:
43   CommRecvTransition(aid_t issuer, int times_considered, char* buffer);
44   std::string to_string(bool verbose) override;
45   bool depends(const Transition* other) const override;
46 };
47
48 class CommSendTransition : public Transition {
49   unsigned mbox_;
50   void* src_buff_;
51   size_t size_;
52
53 public:
54   CommSendTransition(aid_t issuer, int times_considered, char* buffer);
55   std::string to_string(bool verbose) override;
56   bool depends(const Transition* other) const override;
57 };
58
59 /** Make a new transition from serialized description */
60 Transition* recv_transition(aid_t issuer, int times_considered, kernel::actor::SimcallObserver::Simcall simcall,
61                             char* buffer);
62
63 } // namespace mc
64 } // namespace simgrid
65
66 #endif