Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Inline a function of mc::api
[simgrid.git] / src / mc / Transition.cpp
index 61623be629955df0d4d0d8899f8d4f2774652aa8..134452e310efdcf3f5e75ea9ecff0c00ed28fb09 100644 (file)
@@ -4,44 +4,47 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/mc/Transition.hpp"
-#include "src/mc/ModelChecker.hpp"
-#include "src/mc/Session.hpp"
-#include "src/mc/mc_state.hpp"
-#include "src/mc/remote/RemoteProcess.hpp"
+#include "src/mc/TransitionComm.hpp"
 #include "xbt/asserts.h"
+#include <simgrid/config.h>
+#if SIMGRID_HAVE_MC
+#include "src/mc/ModelChecker.hpp"
+#endif
+
+#include <sstream>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_transition, mc, "Logging specific to MC transitions");
 
 namespace simgrid {
 namespace mc {
 unsigned long Transition::executed_transitions_ = 0;
+unsigned long Transition::replayed_transitions_ = 0;
 
-std::string Transition::to_string() const
-{
-  xbt_assert(mc_model_checker != nullptr, "Must be called from MCer");
+Transition::~Transition() {
+} // Make sure that we have a vtable for Transition by putting this virtual function out of the header
 
+std::string Transition::to_string(bool verbose)
+{
   return textual_;
 }
-const char* Transition::to_cstring() const
+const char* Transition::to_cstring(bool verbose)
 {
-  xbt_assert(mc_model_checker != nullptr, "Must be called from MCer");
-
+  to_string();
   return textual_.c_str();
 }
 void Transition::init(aid_t aid, int times_considered)
 {
   aid_              = aid;
   times_considered_ = times_considered;
-  textual_ = mc_model_checker->simcall_to_string(aid_, times_considered_);
 }
-RemotePtr<simgrid::kernel::actor::SimcallObserver> Transition::replay() const
+void Transition::replay() const
 {
-  executed_transitions_++;
+  replayed_transitions_++;
 
-  simgrid::mc::RemotePtr<simgrid::kernel::actor::SimcallObserver> res = mc_model_checker->handle_simcall(*this);
+#if SIMGRID_HAVE_MC
+  mc_model_checker->handle_simcall(*this, false);
   mc_model_checker->wait_for_requests();
-
-  return res;
+#endif
 }
 
 } // namespace mc