X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/29a3b2869c0075fc75e8ccc66fc1d9c4c8bf6a85..1c75860aa49dbde3f251678a7d00a2e27660efa8:/src/kernel/routing/NetZoneImpl.cpp diff --git a/src/kernel/routing/NetZoneImpl.cpp b/src/kernel/routing/NetZoneImpl.cpp index bdc9a7e2a4..670720c3cf 100644 --- a/src/kernel/routing/NetZoneImpl.cpp +++ b/src/kernel/routing/NetZoneImpl.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2006-2019. 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. */ @@ -26,14 +26,14 @@ public: std::vector links; }; -NetZoneImpl::NetZoneImpl(NetZoneImpl* father, std::string name, resource::NetworkModel* network_model) +NetZoneImpl::NetZoneImpl(NetZoneImpl* father, const std::string& name, resource::NetworkModel* network_model) : network_model_(network_model), piface_(this), father_(father), name_(name) { - xbt_assert(nullptr == simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(name.c_str()), - "Refusing to create a second NetZone called '%s'.", name.c_str()); + xbt_assert(nullptr == simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(get_name()), + "Refusing to create a second NetZone called '%s'.", get_cname()); - netpoint_ = new NetPoint(name, NetPoint::Type::NetZone, father); - XBT_DEBUG("NetZone '%s' created with the id '%u'", name.c_str(), netpoint_->id()); + netpoint_ = new NetPoint(name_, NetPoint::Type::NetZone, father); + XBT_DEBUG("NetZone '%s' created with the id '%u'", get_cname(), netpoint_->id()); } NetZoneImpl::~NetZoneImpl() @@ -92,8 +92,8 @@ int NetZoneImpl::get_host_count() return count; } -simgrid::s4u::Host* NetZoneImpl::create_host(const char* name, std::vector* speedPerPstate, int coreAmount, - std::map* props) +simgrid::s4u::Host* NetZoneImpl::create_host(const char* name, const std::vector& speed_per_pstate, + int coreAmount, const std::map* props) { simgrid::s4u::Host* res = new simgrid::s4u::Host(name); @@ -102,11 +102,10 @@ simgrid::s4u::Host* NetZoneImpl::create_host(const char* name, std::vectorpimpl_netpoint = new NetPoint(name, NetPoint::Type::Host, this); - surf_cpu_model_pm->create_cpu(res, speedPerPstate, coreAmount); + surf_cpu_model_pm->create_cpu(res, speed_per_pstate, coreAmount); if (props != nullptr) - for (auto const& kv : *props) - res->set_property(kv.first, kv.second); + res->set_properties(*props); simgrid::s4u::Host::on_creation(*res); // notify the signal @@ -122,11 +121,11 @@ void NetZoneImpl::add_route(kernel::routing::NetPoint* /*src*/, kernel::routing: kernel::routing::NetPoint* /*gw_src*/, kernel::routing::NetPoint* /*gw_dst*/, std::vector& /*link_list*/, bool /*symmetrical*/) { - xbt_die("NetZone '%s' does not accept new routes (wrong class).", name_.c_str()); + xbt_die("NetZone '%s' does not accept new routes (wrong class).", get_cname()); } void NetZoneImpl::add_bypass_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, - std::vector& link_list, bool symmetrical) + std::vector& link_list, bool /* symmetrical */) { /* Argument validity checks */ if (gw_dst) {