char as_typename[INSTR_DEFAULT_STR_SIZE];
snprintf(as_typename, INSTR_DEFAULT_STR_SIZE, "L%d", this->level_);
if (this->father_) {
- this->type_ = simgrid::instr::Type::getOrNull(as_typename, this->father_->type_);
+ this->type_ = this->father_->type_->getChildOrNull(as_typename);
if (this->type_ == nullptr) {
this->type_ = simgrid::instr::Type::containerNew(as_typename, this->father_->type_);
}
THROWF (tracing_error, 0, "new container kind is unknown.");
break;
}
- simgrid::instr::Type* type = simgrid::instr::Type::getOrNull(typeNameBuff, this->father_->type_);
+ simgrid::instr::Type* type = this->father_->type_->getChildOrNull(typeNameBuff);
if (type == nullptr){
this->type_ = simgrid::instr::Type::containerNew(typeNameBuff, this->father_->type_);
}else{
}
//register all kinds by name
- if (allContainers.find(this->name_) != allContainers.end()) {
+ if (not allContainers.emplace(this->name_, this).second) {
THROWF(tracing_error, 1, "container %s already present in allContainers data structure", this->name_);
}
- allContainers.emplace(this->name_, this);
XBT_DEBUG("Add container name '%s'", this->name_);
//register NODE types for triva configuration
simgrid::instr::Container* PJ_container_get_or_null(const char* name)
{
- if (allContainers.find(name) == allContainers.end())
- return nullptr;
- return allContainers.at(name);
+ auto cont = allContainers.find(name);
+ return cont == allContainers.end() ? nullptr : cont->second;
}
simgrid::instr::Container* PJ_container_get_root()