Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
MC: move the reversible_race logic to the Transition class
[simgrid.git] / src / mc / transition / TransitionActor.hpp
1 /* Copyright (c) 2015-2023. 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_ACTOR_HPP
7 #define SIMGRID_MC_TRANSITION_ACTOR_HPP
8
9 #include "src/kernel/actor/SimcallObserver.hpp"
10 #include "src/mc/transition/Transition.hpp"
11
12 #include <cstdint>
13 #include <sstream>
14 #include <string>
15
16 namespace simgrid::mc {
17
18 class ActorJoinTransition : public Transition {
19   bool timeout_;
20   aid_t target_;
21
22 public:
23   ActorJoinTransition(aid_t issuer, int times_considered, std::stringstream& stream);
24   std::string to_string(bool verbose) const override;
25   bool depends(const Transition* other) const override;
26   bool reversible_race(const Transition* other) const override;
27
28   bool get_timeout() const { return timeout_; }
29   /** Target ID */
30   aid_t get_target() const { return target_; }
31 };
32
33 class ActorSleepTransition : public Transition {
34
35 public:
36   ActorSleepTransition(aid_t issuer, int times_considered, std::stringstream& stream);
37   std::string to_string(bool verbose) const override;
38   bool depends(const Transition* other) const override;
39   bool reversible_race(const Transition* other) const override;
40 };
41
42 } // namespace simgrid::mc
43
44 #endif