Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rework way of creating Type hierarchy.
[simgrid.git] / src / msg / msg_vm.cpp
index c6449bb..126d3d8 100644 (file)
@@ -170,8 +170,8 @@ void MSG_vm_destroy(msg_vm_t vm)
   simgrid::simix::kernelImmediate([vm]() { vm->destroy(); });
 
   if (TRACE_msg_vm_is_enabled()) {
-    container_t container = PJ_container_get(vm->getCname());
-    PJ_container_remove_from_parent(container);
+    container_t container = simgrid::instr::Container::byName(vm->getName());
+    container->removeFromParent();
     delete container;
   }
 }
@@ -185,8 +185,8 @@ void MSG_vm_start(msg_vm_t vm)
 {
   vm->start();
   if (TRACE_msg_vm_is_enabled()) {
-    container_t vm_container = PJ_container_get(vm->getCname());
-    simgrid::instr::Type* type = vm_container->type_->getChild("MSG_VM_STATE");
+    container_t vm_container   = simgrid::instr::Container::byName(vm->getName());
+    simgrid::instr::Type* type = vm_container->type_->byName("MSG_VM_STATE");
     simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate("start", "0 0 1", type); // start is blue
     new simgrid::instr::PushStateEvent(MSG_get_clock(), vm_container, type, val);
   }
@@ -294,22 +294,22 @@ static int migration_rx_fun(int argc, char *argv[])
     counter++;
 
     // start link
-    container_t msg = PJ_container_get(vm->getCname());
-    simgrid::instr::Type* type = PJ_type_get_root()->getChild("MSG_VM_LINK");
+    container_t msg            = simgrid::instr::Container::byName(vm->getName());
+    simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->byName("MSG_VM_LINK");
     new simgrid::instr::StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
 
     // destroy existing container of this vm
-    container_t existing_container = PJ_container_get(vm->getCname());
-    PJ_container_remove_from_parent(existing_container);
+    container_t existing_container = simgrid::instr::Container::byName(vm->getName());
+    existing_container->removeFromParent();
     delete existing_container;
 
     // create new container on the new_host location
     new simgrid::instr::Container(vm->getCname(), simgrid::instr::INSTR_MSG_VM,
-                                  PJ_container_get(ms->dst_pm->getCname()));
+                                  simgrid::instr::Container::byName(ms->dst_pm->getName()));
 
     // end link
-    msg  = PJ_container_get(vm->getCname());
-    type = PJ_type_get_root()->getChild("MSG_VM_LINK");
+    msg  = simgrid::instr::Container::byName(vm->getName());
+    type = simgrid::instr::Type::getRootType()->byName("MSG_VM_LINK");
     new simgrid::instr::EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
   }
 
@@ -768,8 +768,8 @@ void MSG_vm_suspend(msg_vm_t vm)
   XBT_DEBUG("vm_suspend done");
 
   if (TRACE_msg_vm_is_enabled()) {
-    container_t vm_container = PJ_container_get(vm->getCname());
-    simgrid::instr::Type* type = vm_container->type_->getChild("MSG_VM_STATE");
+    container_t vm_container   = simgrid::instr::Container::byName(vm->getName());
+    simgrid::instr::Type* type = vm_container->type_->byName("MSG_VM_STATE");
     simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate("suspend", "1 0 0", type); // suspend is red
     new simgrid::instr::PushStateEvent(MSG_get_clock(), vm_container, type, val);
   }
@@ -785,8 +785,8 @@ void MSG_vm_resume(msg_vm_t vm)
   vm->pimpl_vm_->resume();
 
   if (TRACE_msg_vm_is_enabled()) {
-    container_t vm_container = PJ_container_get(vm->getCname());
-    simgrid::instr::Type* type = vm_container->type_->getChild("MSG_VM_STATE");
+    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);
   }
 }