X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/db9ef2223acb402e44eec406541e671bfebd5ade..9cc88b5ca5bce4893bbb192a38c6f175f5504cc0:/src/instr/instr_paje_containers.cpp diff --git a/src/instr/instr_paje_containers.cpp b/src/instr/instr_paje_containers.cpp index 3d680b27b1..5ebe79a08a 100644 --- a/src/instr/instr_paje_containers.cpp +++ b/src/instr/instr_paje_containers.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2022. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-2023. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -10,8 +10,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_containers, instr, "Paje tracing event system (containers)"); -namespace simgrid { -namespace instr { +namespace simgrid::instr { Container* Container::root_container_ = nullptr; /* the root container */ std::map> Container::all_containers_; /* all created containers indexed by name */ @@ -21,7 +20,7 @@ NetZoneContainer::NetZoneContainer(const std::string& name, unsigned int level, { xbt_assert(s4u::Engine::get_instance()->netpoint_by_name_or_null(get_name()), "Element '%s' not found", get_cname()); if (parent_) { - std::string type_name = std::string("L") + std::to_string(level); + std::string type_name = "L" + std::to_string(level); type_ = parent_->type_->by_name_or_create(type_name); parent_->children_.try_emplace(get_name(), this); on_creation(*this); @@ -74,8 +73,8 @@ Container::~Container() { XBT_DEBUG("destroy container %s", get_cname()); // Begin with destroying my own children - for (auto child : children_) - delete child.second; + for (auto const& [_, child] : children_) + delete child; // remove me from the all_containers_ data structure all_containers_.erase(name_); @@ -136,5 +135,4 @@ EntityValue::EntityValue(const std::string& name, const std::string& color, Type on_creation(*this); } -} // namespace instr -} // namespace simgrid +} // namespace simgrid::instr