Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
use c++ strings for s4u::Actor names
[simgrid.git] / include / simgrid / s4u / Actor.hpp
index 89a7727..7f3f4a6 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <xbt/base.h>
 #include <xbt/functional.hpp>
+#include <xbt/string.hpp>
 
 #include <simgrid/chrono.hpp>
 #include <simgrid/simix.h>
@@ -146,7 +147,7 @@ XBT_PUBLIC_CLASS Actor {
     };
   }
 
-  Actor(smx_process_t pimpl) : pimpl_(pimpl) {}
+  explicit Actor(smx_process_t pimpl) : pimpl_(pimpl) {}
 
 public:
 
@@ -170,6 +171,8 @@ public:
   using Ptr = boost::intrusive_ptr<Actor>;
 
   // ***** Actor creation *****
+  /** Retrieve a reference to myself */
+  static Ptr self();
 
   /** Create an actor using a function
    *
@@ -215,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 */
@@ -231,7 +234,8 @@ public:
   /** Ask the actor to die.
    *
    * It will only notice your request when doing a simcall next time (a communication or similar).
-   * SimGrid sometimes have issues when you kill actors that are currently communicating and such. We are working on it to fix the issues.
+   * SimGrid sometimes have issues when you kill actors that are currently communicating and such.
+   * We are working on it to fix the issues.
    */
   void kill();