Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Pointer to const.
[simgrid.git] / src / s4u / s4u_Activity.cpp
index 529d08f..55bba1e 100644 (file)
@@ -65,25 +65,9 @@ Activity* Activity::resume()
   return this;
 }
 
-const char* Activity::get_state_str()
+const char* Activity::get_state_str() const
 {
-  switch (state_) {
-    case State::INITED:
-      return "INITED";
-
-    case State::STARTING:
-      return "STARTING";
-
-    case State::STARTED:
-      return "STARTED";
-
-    case State::CANCELED:
-      return "CANCELED";
-
-    case State::FINISHED:
-      return "FINISHED";
-  }
-  THROW_IMPOSSIBLE;
+  return to_c_str(state_);
 }
 
 double Activity::get_remaining() const