Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Start moving classes into the mc/api directory
[simgrid.git] / src / mc / api / 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 "src/kernel/actor/SimcallObserver.hpp"
11 #include "src/mc/api/Transition.hpp"
12
13 #include <string>
14
15 namespace simgrid {
16 namespace mc {
17
18 class CommSendTransition;
19 class CommRecvTransition;
20
21 class CommWaitTransition : public Transition {
22   bool timeout_;
23   void* comm_;
24   aid_t sender_;
25   aid_t receiver_;
26   unsigned mbox_;
27   void* src_buff_;
28   void* dst_buff_;
29   size_t size_;
30   friend CommSendTransition;
31   friend CommRecvTransition;
32
33 public:
34   CommWaitTransition(aid_t issuer, int times_considered, char* buffer);
35   std::string to_string(bool verbose) override;
36   bool depends(const Transition* other) const override;
37 };
38
39 class CommRecvTransition : public Transition {
40   unsigned mbox_;
41   void* dst_buff_;
42
43 public:
44   CommRecvTransition(aid_t issuer, int times_considered, char* buffer);
45   std::string to_string(bool verbose) override;
46   bool depends(const Transition* other) const override;
47 };
48
49 class CommSendTransition : public Transition {
50   unsigned mbox_;
51   void* src_buff_;
52   size_t size_;
53
54 public:
55   CommSendTransition(aid_t issuer, int times_considered, char* buffer);
56   std::string to_string(bool verbose) override;
57   bool depends(const Transition* other) const override;
58 };
59
60 /** Make a new transition from serialized description */
61 Transition* recv_transition(aid_t issuer, int times_considered, kernel::actor::SimcallObserver::Simcall simcall,
62                             char* buffer);
63
64 } // namespace mc
65 } // namespace simgrid
66
67 #endif