Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'wifi_clean' into 'master'
[simgrid.git] / src / mc / transition / Transition.hpp
index e8b8727..19e30b9 100644 (file)
@@ -12,8 +12,7 @@
 #include <sstream>
 #include <string>
 
-namespace simgrid {
-namespace mc {
+namespace simgrid::mc {
 
 /** An element in the recorded path
  *
@@ -32,7 +31,12 @@ class Transition {
 
 public:
   /* Ordering is important here. depends() implementations only consider subsequent types in this ordering */
-  XBT_DECLARE_ENUM_CLASS(Type, RANDOM, TESTANY, WAITANY, COMM_RECV, COMM_SEND, COMM_TEST, COMM_WAIT,
+  XBT_DECLARE_ENUM_CLASS(Type, RANDOM,               /* First because indep with anybody */
+                         TESTANY, WAITANY,           /* high priority because they can rewrite themselves to *_WAIT */
+                         BARRIER_LOCK, BARRIER_WAIT, /* BARRIER transitions sorted alphabetically */
+                         COMM_RECV, COMM_SEND, COMM_TEST, COMM_WAIT, /* Alphabetical ordering of COMM_* */
+                         MUTEX_LOCK, MUTEX_TEST, MUTEX_TRYLOCK, MUTEX_UNLOCK, MUTEX_WAIT, /* alphabetical */
+                         SEM_LOCK, SEM_UNLOCK, SEM_WAIT, /* alphabetical ordering of SEM transitions */
                          /* UNKNOWN must be last */ UNKNOWN);
   Type type_ = Type::UNKNOWN;
 
@@ -55,8 +59,10 @@ public:
   }
   virtual ~Transition();
 
+  /** Returns a textual representation of the transition. Pointer adresses are omitted if verbose=false */
   virtual std::string to_string(bool verbose = false) const;
-  virtual std::string dot_label() const;
+  /** Returns something like >>label = "desc", color = c<< to describe the transition in dot format */
+  virtual std::string dot_string() const;
 
   /* Moves the application toward a path that was already explored, but don't change the current transition */
   void replay() const;
@@ -72,7 +78,6 @@ public:
 /** Make a new transition from serialized description */
 Transition* deserialize_transition(aid_t issuer, int times_considered, std::stringstream& stream);
 
-} // namespace mc
-} // namespace simgrid
+} // namespace simgrid::mc
 
 #endif