Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add an easy way to retrieve the name of the current actor
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 7 Mar 2017 10:53:52 +0000 (11:53 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 7 Mar 2017 10:56:53 +0000 (11:56 +0100)
include/simgrid/s4u/Actor.hpp
src/s4u/s4u_actor.cpp

index d014cef..0a14c7d 100644 (file)
@@ -289,11 +289,14 @@ namespace this_actor {
   */
   XBT_PUBLIC(void) send(MailboxPtr chan, void*payload, size_t simulatedSize);
 
-  /** @brief Return the PID of the current actor. */
+  /** @brief Returns the PID of the current actor. */
   XBT_PUBLIC(int) pid();
 
-  /** @brief Return the PPID of the current actor. */
+  /** @brief Returns the PPID of the current actor. */
   int ppid();
+
+  /** @brief Returns the name of the current actor. */
+  std::string name();
 };
 
 /** @} */
index 28833f1..257717f 100644 (file)
@@ -163,6 +163,10 @@ int ppid()
   return SIMIX_process_self()->ppid;
 }
 
+std::string name()
+{
+  return SIMIX_process_self()->name;
+}
 }
 }
 }