return ret;
}
-}
-}
-void PJ_container_remove_from_parent (container_t child)
+void Container::removeFromParent()
{
- if (child == nullptr){
- THROWF (tracing_error, 0, "can't remove from parent with a nullptr child");
- }
-
- container_t parent = child->father_;
- if (parent){
- XBT_DEBUG("removeChildContainer (%s) FromContainer (%s) ", child->name_.c_str(), parent->name_.c_str());
- parent->children_.erase(child->name_);
+ if (father_) {
+ XBT_DEBUG("removeChildContainer (%s) FromContainer (%s) ", name_.c_str(), father_->name_.c_str());
+ father_->children_.erase(name_);
}
}
+}
+}
e_container_types kind_; /* This container is of what kind */
Container* father_;
std::map<std::string, Container*> children_;
- static simgrid::instr::Container* byNameOrNull(std::string name);
- static simgrid::instr::Container* byName(std::string name);
+ static Container* byNameOrNull(std::string name);
+ static Container* byName(std::string name);
+ void removeFromParent();
};
//--------------------------------------------------
XBT_PRIVATE long long int instr_new_paje_id();
XBT_PUBLIC(container_t) PJ_container_get_root ();
XBT_PUBLIC(void) PJ_container_set_root (container_t root);
-XBT_PUBLIC(void) PJ_container_remove_from_parent (container_t container);
/* instr_paje_types.c */
XBT_PUBLIC(simgrid::instr::Type*) PJ_type_get_root();
container_t process =
simgrid::instr::Container::byNameOrNull(instr_process_id_2(process_name, process_pid, str, len));
if (process) {
- PJ_container_remove_from_parent (process);
+ process->removeFromParent();
delete process;
}
}
if (TRACE_msg_vm_is_enabled()) {
container_t container = simgrid::instr::Container::byName(vm->getName());
- PJ_container_remove_from_parent(container);
+ container->removeFromParent();
delete container;
}
}
// destroy existing container of this vm
container_t existing_container = simgrid::instr::Container::byName(vm->getName());
- PJ_container_remove_from_parent(existing_container);
+ existing_container->removeFromParent();
delete existing_container;
// create new container on the new_host location
char str[INSTR_DEFAULT_STR_SIZE];
container_t container = simgrid::instr::Container::byName(smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE));
- PJ_container_remove_from_parent (container);
+ container->removeFromParent();
delete container;
}