From: Arnaud Giersch Date: Wed, 13 Feb 2019 10:39:19 +0000 (+0100) Subject: Use get_cname() instead of name_.c_str(). X-Git-Tag: v3_22~330 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d07491b881cc0dd542507d598e1099f178b79c59 Use get_cname() instead of name_.c_str(). --- diff --git a/src/instr/instr_paje_containers.cpp b/src/instr/instr_paje_containers.cpp index 17bff97aa0..244c9d5474 100644 --- a/src/instr/instr_paje_containers.cpp +++ b/src/instr/instr_paje_containers.cpp @@ -78,7 +78,7 @@ Container::Container(std::string name, const std::string& type_name, Container* container_id++; if (father_) { - XBT_DEBUG("new container %s, child of %s", name.c_str(), father->name_.c_str()); + XBT_DEBUG("new container %s, child of %s", get_cname(), father->get_cname()); if (not type_name.empty()) { type_ = father_->type_->by_name_or_create(type_name); @@ -89,9 +89,9 @@ Container::Container(std::string name, const std::string& type_name, Container* //register all kinds by name if (not allContainers.emplace(name_, this).second) - THROWF(tracing_error, 1, "container %s already present in allContainers data structure", name_.c_str()); + THROWF(tracing_error, 1, "container %s already present in allContainers data structure", get_cname()); - XBT_DEBUG("Add container name '%s'", name_.c_str()); + XBT_DEBUG("Add container name '%s'", get_cname()); //register NODE types for triva configuration if (type_name == "LINK") @@ -100,7 +100,7 @@ Container::Container(std::string name, const std::string& type_name, Container* Container::~Container() { - XBT_DEBUG("destroy container %s", name_.c_str()); + XBT_DEBUG("destroy container %s", get_cname()); // Begin with destroying my own children for (auto child : children_) delete child.second; diff --git a/src/instr/instr_paje_types.cpp b/src/instr/instr_paje_types.cpp index 9fb43d720c..c08aea0b05 100644 --- a/src/instr/instr_paje_types.cpp +++ b/src/instr/instr_paje_types.cpp @@ -23,7 +23,7 @@ Type::Type(std::string name, std::string alias, std::string color, Type* father) if (father != nullptr){ father->children_.insert({std::move(alias), this}); - XBT_DEBUG("new type %s, child of %s", name_.c_str(), father->get_cname()); + XBT_DEBUG("new type %s, child of %s", get_cname(), father->get_cname()); } if (trace_format == simgrid::instr::TraceFormat::Paje) { stream_ << std::fixed << std::setprecision(TRACE_precision()); diff --git a/src/kernel/activity/ExecImpl.cpp b/src/kernel/activity/ExecImpl.cpp index fbfe28c475..83e7e88da5 100644 --- a/src/kernel/activity/ExecImpl.cpp +++ b/src/kernel/activity/ExecImpl.cpp @@ -49,7 +49,7 @@ ExecImpl* ExecImpl::start(double flops_amount, double priority, double bound) surf_action_->set_bound(bound); } - XBT_DEBUG("Create execute synchro %p: %s", this, name_.c_str()); + XBT_DEBUG("Create execute synchro %p: %s", this, get_cname()); ExecImpl::on_creation(this); return this; } diff --git a/src/kernel/activity/IoImpl.cpp b/src/kernel/activity/IoImpl.cpp index 7f8d60bd95..0f8a3ed701 100644 --- a/src/kernel/activity/IoImpl.cpp +++ b/src/kernel/activity/IoImpl.cpp @@ -32,7 +32,7 @@ IoImpl* IoImpl::start(sg_size_t size, simgrid::s4u::Io::OpType type) surf_action_ = storage_->io_start(size, type); surf_action_->set_data(this); - XBT_DEBUG("Create IO synchro %p %s", this, name_.c_str()); + XBT_DEBUG("Create IO synchro %p %s", this, get_cname()); simgrid::kernel::activity::IoImpl::on_start(this); return this; diff --git a/src/kernel/routing/NetZoneImpl.cpp b/src/kernel/routing/NetZoneImpl.cpp index f61f9dfa50..fc33fd29aa 100644 --- a/src/kernel/routing/NetZoneImpl.cpp +++ b/src/kernel/routing/NetZoneImpl.cpp @@ -29,11 +29,11 @@ public: NetZoneImpl::NetZoneImpl(NetZoneImpl* father, std::string name, resource::NetworkModel* network_model) : network_model_(network_model), piface_(this), father_(father), name_(std::move(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()); + XBT_DEBUG("NetZone '%s' created with the id '%u'", get_cname(), netpoint_->id()); } NetZoneImpl::~NetZoneImpl() @@ -122,7 +122,7 @@ 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, diff --git a/src/s4u/s4u_Host.cpp b/src/s4u/s4u_Host.cpp index 5e6879cbbb..95002eda7b 100644 --- a/src/s4u/s4u_Host.cpp +++ b/src/s4u/s4u_Host.cpp @@ -31,7 +31,7 @@ simgrid::xbt::signal Host::on_speed_change; Host::Host(std::string name) : name_(std::move(name)) { - xbt_assert(Host::by_name_or_null(name_) == nullptr, "Refusing to create a second host named '%s'.", name_.c_str()); + xbt_assert(Host::by_name_or_null(name_) == nullptr, "Refusing to create a second host named '%s'.", get_cname()); Engine::get_instance()->host_register(std::string(name_), this); new simgrid::surf::HostImpl(this); } diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index 2a5262f149..6d0d347495 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -148,7 +148,7 @@ void ActorImpl::exit() io->cancel(); } else { simgrid::kernel::activity::ActivityImplPtr activity = waiting_synchro; - xbt_die("Activity %s is of unknown type %s", activity->name_.c_str(), + xbt_die("Activity %s is of unknown type %s", activity->get_cname(), simgrid::xbt::demangle(typeid(activity).name()).get()); } diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index c696cab45d..2056a852bc 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -582,7 +582,7 @@ void SIMIX_display_process_status() XBT_INFO("Process %ld (%s@%s): waiting for %s synchro %p (%s) in state %d to finish", process->pid_, process->get_cname(), process->host_->get_cname(), synchro_description, process->waiting_synchro.get(), - process->waiting_synchro->name_.c_str(), (int)process->waiting_synchro->state_); + process->waiting_synchro->get_cname(), (int)process->waiting_synchro->state_); } else { XBT_INFO("Process %ld (%s@%s)", process->pid_, process->get_cname(), process->host_->get_cname());