Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
use c++ strings for s4u::Actor names
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 31 Jul 2016 20:47:34 +0000 (22:47 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 31 Jul 2016 20:47:34 +0000 (22:47 +0200)
include/simgrid/s4u/Actor.hpp
src/s4u/s4u_actor.cpp

index 99f4a8a..7f3f4a6 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <xbt/base.h>
 #include <xbt/functional.hpp>
 
 #include <xbt/base.h>
 #include <xbt/functional.hpp>
+#include <xbt/string.hpp>
 
 #include <simgrid/chrono.hpp>
 #include <simgrid/simix.h>
 
 #include <simgrid/chrono.hpp>
 #include <simgrid/simix.h>
@@ -217,7 +218,7 @@ public:
   //static Actor *byPid(int pid); not implemented
 
   /** Retrieves the name of that actor */
   //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 */
   /** Retrieves the host on which that actor is running */
   s4u::Host *getHost();
   /** Retrieves the PID of that actor */
index 79212bc..5ea9f88 100644 (file)
@@ -65,8 +65,8 @@ s4u::Host *Actor::getHost() {
   return pimpl_->host;
 }
 
   return pimpl_->host;
 }
 
-const char* Actor::getName() {
-  return pimpl_->name.c_str();
+simgrid::xbt::string Actor::getName() {
+  return pimpl_->name;
 }
 
 int Actor::getPid(){
 }
 
 int Actor::getPid(){