Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rework State related events
[simgrid.git] / src / msg / msg_vm.cpp
index a18f43c..ce7c0a4 100644 (file)
@@ -186,9 +186,10 @@ void MSG_vm_start(msg_vm_t vm)
   vm->start();
   if (TRACE_msg_vm_is_enabled()) {
     container_t vm_container    = simgrid::instr::Container::byName(vm->getName());
-    simgrid::instr::Type* state = vm_container->type_->byName("MSG_VM_STATE");
+    simgrid::instr::StateType* state =
+        static_cast<simgrid::instr::StateType*>(vm_container->type_->byName("MSG_VM_STATE"));
     state->addEntityValue("start", "0 0 1"); // start is blue
-    new simgrid::instr::PushStateEvent(MSG_get_clock(), vm_container, state, state->getEntityValue("start"));
+    state->pushEvent(MSG_get_clock(), vm_container, "start");
   }
 }
 
@@ -769,9 +770,10 @@ void MSG_vm_suspend(msg_vm_t vm)
 
   if (TRACE_msg_vm_is_enabled()) {
     container_t vm_container    = simgrid::instr::Container::byName(vm->getName());
-    simgrid::instr::Type* state = vm_container->type_->byName("MSG_VM_STATE");
+    simgrid::instr::StateType* state =
+        static_cast<simgrid::instr::StateType*>(vm_container->type_->byName("MSG_VM_STATE"));
     state->addEntityValue("suspend", "1 0 0"); // suspend is red
-    new simgrid::instr::PushStateEvent(MSG_get_clock(), vm_container, state, state->getEntityValue("suspend"));
+    state->pushEvent(MSG_get_clock(), vm_container, "suspend");
   }
 }
 
@@ -786,8 +788,9 @@ void MSG_vm_resume(msg_vm_t vm)
 
   if (TRACE_msg_vm_is_enabled()) {
     container_t vm_container   = simgrid::instr::Container::byName(vm->getName());
-    simgrid::instr::Type* type = vm_container->type_->byName("MSG_VM_STATE");
-    new simgrid::instr::PopStateEvent(MSG_get_clock(), vm_container, type);
+    simgrid::instr::StateType* state =
+        static_cast<simgrid::instr::StateType*>(vm_container->type_->byName("MSG_VM_STATE"));
+    state->popEvent(MSG_get_clock(), vm_container);
   }
 }