X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5ed37babb2fa9097abe82df299c0aa259ed84d5a..102c27957beb3025cec67dda5e11590e60f8a682:/src/mc/mc_record.hpp diff --git a/src/mc/mc_record.hpp b/src/mc/mc_record.hpp index 2958780644..32f78efa11 100644 --- a/src/mc/mc_record.hpp +++ b/src/mc/mc_record.hpp @@ -9,7 +9,7 @@ * The recorded path is written in the log output and can be replayed with MC disabled * (even with a non-MC build) using `--cfg=model-check/replay:$replayPath`. * - * The same version of Simgrid should be used and the same arguments should be + * The same version of SimGrid should be used and the same arguments should be * passed to the application (without the MC specific arguments). */ @@ -19,23 +19,30 @@ #include "src/mc/mc_forward.hpp" #include "xbt/base.h" +#include #include -#include namespace simgrid::mc { class RecordTrace { - std::vector transitions_; + std::deque transitions_; public: - RecordTrace() = default; + // Use rule-of-three, and implicitely disable the move constructor which cannot be 'noexcept' (as required by C++ Core + // Guidelines), due to the std::deque member. + RecordTrace() = default; + RecordTrace(const RecordTrace&) = default; + ~RecordTrace() = default; /** Build a trace that can be replayed from a string representation */ explicit RecordTrace(const char* data); /** Make a string representation that can later be used to create a new trace */ std::string to_string() const; + void push_front(Transition* t) { transitions_.push_front(t); } void push_back(Transition* t) { transitions_.push_back(t); } + std::deque::const_iterator begin() const { return transitions_.begin(); } + std::deque::const_iterator end() const { return transitions_.end(); } /** Replay all transitions of a trace */ void replay() const;