From 755eca55d26d26cf6a09369dfffe9359c2b2f847 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 31 Jul 2016 22:47:34 +0200 Subject: [PATCH 1/1] use c++ strings for s4u::Actor names --- include/simgrid/s4u/Actor.hpp | 3 ++- src/s4u/s4u_actor.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/simgrid/s4u/Actor.hpp b/include/simgrid/s4u/Actor.hpp index 99f4a8a0e4..7f3f4a6267 100644 --- a/include/simgrid/s4u/Actor.hpp +++ b/include/simgrid/s4u/Actor.hpp @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -217,7 +218,7 @@ public: //static Actor *byPid(int pid); not implemented /** Retrieves the name of that actor */ - const char* getName(); + simgrid::xbt::string getName(); /** Retrieves the host on which that actor is running */ s4u::Host *getHost(); /** Retrieves the PID of that actor */ diff --git a/src/s4u/s4u_actor.cpp b/src/s4u/s4u_actor.cpp index 79212bc73c..5ea9f88b17 100644 --- a/src/s4u/s4u_actor.cpp +++ b/src/s4u/s4u_actor.cpp @@ -65,8 +65,8 @@ s4u::Host *Actor::getHost() { return pimpl_->host; } -const char* Actor::getName() { - return pimpl_->name.c_str(); +simgrid::xbt::string Actor::getName() { + return pimpl_->name; } int Actor::getPid(){ -- 2.20.1