Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
bea07f268f94a512bbe81d78937feabe5bdd62d8
[simgrid.git] / src / mc / transition / TransitionSynchro.hpp
1 /* Copyright (c) 2015-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 SIMGRID_MC_TRANSITION_SYNCHRO_HPP
7 #define SIMGRID_MC_TRANSITION_SYNCHRO_HPP
8
9 #include "src/mc/transition/Transition.hpp"
10
11 namespace simgrid {
12 namespace mc {
13
14 class BarrierTransition : public Transition {
15   unsigned bar_;
16
17 public:
18   std::string to_string(bool verbose) const override;
19   BarrierTransition(aid_t issuer, int times_considered, Type type, std::stringstream& stream);
20   bool depends(const Transition* other) const override;
21 };
22
23 class MutexTransition : public Transition {
24   uintptr_t mutex_;
25   aid_t owner_;
26
27 public:
28   std::string to_string(bool verbose) const override;
29   MutexTransition(aid_t issuer, int times_considered, Type type, std::stringstream& stream);
30   bool depends(const Transition* other) const override;
31 };
32
33 class SemaphoreTransition : public Transition {
34   uintptr_t sem_;
35   bool granted_;
36
37 public:
38   std::string to_string(bool verbose) const override;
39   SemaphoreTransition(aid_t issuer, int times_considered, Type type, std::stringstream& stream);
40   bool depends(const Transition* other) const override;
41 };
42
43 } // namespace mc
44 } // namespace simgrid
45
46 #endif