- // Search for network_element_t for AS, ROUTER and HOST
- // Name the kind of container. For AS otherwise, the name depends on its level
- std::string typeNameBuff;
- switch (kind_) {
- case INSTR_AS:
- netpoint_ = simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(name);
- xbt_assert(netpoint_, "Element '%s' not found", name.c_str());
- typeNameBuff = std::string("L") + std::to_string(level_);
- break;
- case INSTR_ROUTER:
- netpoint_ = simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(name);
- xbt_assert(netpoint_, "Element '%s' not found", name.c_str());
- typeNameBuff = std::string("ROUTER");
- break;
- case INSTR_HOST:
- netpoint_ = sg_host_by_name(name.c_str())->pimpl_netpoint;
- xbt_assert(netpoint_, "Element '%s' not found", name.c_str());
- typeNameBuff = std::string("HOST");
- break;
- case INSTR_LINK:
- typeNameBuff = std::string("LINK");
- break;
- case INSTR_SMPI:
- typeNameBuff = std::string("MPI");
- break;
- case INSTR_MSG_PROCESS:
- typeNameBuff = std::string("MSG_PROCESS");
- break;
- case INSTR_MSG_VM:
- typeNameBuff = std::string("MSG_VM");
- break;
- case INSTR_MSG_TASK:
- typeNameBuff = std::string("MSG_TASK");
- break;
- default:
- THROWF(tracing_error, 0, "new container kind is unknown.");
- break;
- }
-
- if (father_) {
- type_ = father_->type_->getChildOrNull(typeNameBuff);
- if (type_ == nullptr) {
- type_ = Type::containerNew(typeNameBuff.c_str(), father_->type_);