From: Martin Quinson Date: Sun, 31 Jul 2016 20:47:34 +0000 (+0200) Subject: use c++ strings for s4u::Actor names X-Git-Tag: v3_14~671 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/755eca55d26d26cf6a09369dfffe9359c2b2f847?hp=03847b386b2035bec76237eab400aeaf07466496 use c++ strings for s4u::Actor names --- 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(){