Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
objectifies surf::Action::State
[simgrid.git] / teshsuite / surf / surf_usage / surf_usage.cpp
index 4b5a9e9..17c8002 100644 (file)
 #include "xbt/log.h"
 XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test, "Messages specific for surf example");
 
-static const char *string_action(e_surf_action_state_t state)
+static const char *string_action(simgrid::surf::Action::State state)
 {
   switch (state) {
-  case (SURF_ACTION_READY):
+  case (simgrid::surf::Action::State::ready):
     return "SURF_ACTION_READY";
-  case (SURF_ACTION_RUNNING):
+  case (simgrid::surf::Action::State::running):
     return "SURF_ACTION_RUNNING";
-  case (SURF_ACTION_FAILED):
+  case (simgrid::surf::Action::State::failed):
     return "SURF_ACTION_FAILED";
-  case (SURF_ACTION_DONE):
+  case (simgrid::surf::Action::State::done):
     return "SURF_ACTION_DONE";
-  case (SURF_ACTION_NOT_IN_THE_SYSTEM):
+  case (simgrid::surf::Action::State::not_in_the_system):
     return "SURF_ACTION_NOT_IN_THE_SYSTEM";
   default:
     return "INVALID STATE";
@@ -59,9 +59,9 @@ int main(int argc, char **argv)
   surf_action_t actionC = surf_host_sleep(hostB, 7.32);
 
   /* Use whatever calling style you want... */
-  e_surf_action_state_t stateActionA = actionA->getState(); /* When you know actionA model type */
-  e_surf_action_state_t stateActionB = actionB->getState(); /* If you're unsure about it's model type */
-  e_surf_action_state_t stateActionC = actionC->getState(); /* When you know actionA model type */
+  simgrid::surf::Action::State stateActionA = actionA->getState(); /* When you know actionA model type */
+  simgrid::surf::Action::State stateActionB = actionB->getState(); /* If you're unsure about it's model type */
+  simgrid::surf::Action::State stateActionC = actionC->getState(); /* When you know actionA model type */
 
   /* And just look at the state of these tasks */
   XBT_INFO("actionA state: %s", string_action(stateActionA));