Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[s4u] add Actor::getPPid and this_actor::getPPid()
[simgrid.git] / include / simgrid / s4u / Actor.hpp
index 99f4a8a..a858bdf 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>
@@ -131,7 +132,7 @@ namespace s4u {
 /** @brief Simulation Agent (see \ref s4u_actor)*/
 XBT_PUBLIC_CLASS Actor {
   friend Mailbox;
-  friend simgrid::simix::Process;
+  friend simgrid::simix::ActorImpl;
   smx_process_t pimpl_ = nullptr;
 
   /** Wrap a (possibly non-copyable) single-use task into a `std::function` */
@@ -217,11 +218,13 @@ 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 */
   int getPid();
+  /** Retrieves the PPID of that actor */
+  int getPpid();
 
   /** If set to true, the actor will automatically restart when its host reboots */
   void setAutoRestart(bool autorestart);
@@ -304,6 +307,11 @@ namespace this_actor {
    * Return the PID of the current actor.
    */
   XBT_PUBLIC(int) getPid();
+  
+  /**
+   * Return the PPID of the current actor.
+   */
+  int getPpid();
 
 };