Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Split TransitionAny and TransitionRandom to their own files
[simgrid.git] / src / mc / transition / TransitionAny.hpp
diff --git a/src/mc/transition/TransitionAny.hpp b/src/mc/transition/TransitionAny.hpp
new file mode 100644 (file)
index 0000000..25f67dd
--- /dev/null
@@ -0,0 +1,43 @@
+/* Copyright (c) 2015-2022. The SimGrid Team. All rights reserved.          */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef SIMGRID_MC_TRANSITION_ANY_HPP
+#define SIMGRID_MC_TRANSITION_ANY_HPP
+
+#include "src/kernel/actor/SimcallObserver.hpp"
+#include "src/mc/transition/Transition.hpp"
+
+#include <sstream>
+#include <string>
+
+namespace simgrid {
+namespace mc {
+
+class TestAnyTransition : public Transition {
+  std::vector<Transition*> transitions_;
+
+public:
+  TestAnyTransition(aid_t issuer, int times_considered, std::stringstream& stream);
+  std::string to_string(bool verbose) const override;
+  bool depends(const Transition* other) const override;
+
+  Transition* get_current_transition() const { return transitions_.at(times_considered_); }
+};
+
+class WaitAnyTransition : public Transition {
+  std::vector<Transition*> transitions_;
+
+public:
+  WaitAnyTransition(aid_t issuer, int times_considered, std::stringstream& stream);
+  std::string to_string(bool verbose) const override;
+  bool depends(const Transition* other) const override;
+
+  Transition* get_current_transition() const { return transitions_.at(times_considered_); }
+};
+
+} // namespace mc
+} // namespace simgrid
+
+#endif