Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
give s4u::Host a cname() that returns a char*
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 22 Nov 2016 09:54:09 +0000 (10:54 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 22 Nov 2016 09:54:09 +0000 (10:54 +0100)
include/simgrid/s4u/host.hpp
src/simgrid/host.cpp

index 3fcc5d9..b6e7eff 100644 (file)
@@ -67,6 +67,7 @@ public:
   static s4u::Host *current();
 
   simgrid::xbt::string const& name() const { return name_; }
+  const char* cname() { return name_.c_str(); }
 
   /** Turns that host on if it was previously off
    *
index 90034b0..9ccb263 100644 (file)
@@ -61,7 +61,7 @@ sg_host_t *sg_host_list() {
 
 const char *sg_host_get_name(sg_host_t host)
 {
-  return host->name().c_str();
+  return host->cname();
 }
 
 void* sg_host_extension_get(sg_host_t host, size_t ext)