Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix windows build
[simgrid.git] / include / simgrid / s4u / Actor.hpp
index 2a768f3..72a5c6e 100644 (file)
@@ -155,12 +155,10 @@ XBT_PUBLIC_CLASS Actor : public simgrid::xbt::Extendable<Actor>
 public:
 
   // ***** No copy *****
-
   Actor(Actor const&) = delete;
   Actor& operator=(Actor const&) = delete;
 
   // ***** Reference count (delegated to pimpl_) *****
-
   friend void intrusive_ptr_add_ref(Actor* actor)
   {
     xbt_assert(actor != nullptr);
@@ -180,12 +178,7 @@ public:
    *
    *  If the actor is restarted, the actor has a fresh copy of the function.
    */
-  static ActorPtr createActor(const char* name, s4u::Host *host, double killTime, std::function<void()> code);
-
-  static ActorPtr createActor(const char* name, s4u::Host *host, std::function<void()> code)
-  {
-    return createActor(name, host, -1.0, std::move(code));
-  }
+  static ActorPtr createActor(const char* name, s4u::Host* host, std::function<void()> code);
 
   /** Create an actor using code
    *
@@ -205,18 +198,13 @@ public:
 
   // Create actor from function name:
 
-  static ActorPtr createActor(const char* name, s4u::Host *host, double killTime,
-    const char* function, std::vector<std::string> args);
-
-  static ActorPtr createActor(const char* name, s4u::Host *host, const char* function,
-      std::vector<std::string> args)
-  {
-    return createActor(name, host, -1.0, function, std::move(args));
-  }
+  static ActorPtr createActor(const char* name, s4u::Host* host, const char* function, std::vector<std::string> args);
 
   // ***** Methods *****
 
-  /** Retrieves the name of that actor */
+  /** Retrieves the name of that actor as a C string */
+  const char* cname();
+  /** Retrieves the name of that actor as a C++ string */
   simgrid::xbt::string name();
   /** Retrieves the host on which that actor is running */
   s4u::Host* host();
@@ -256,7 +244,6 @@ public:
   /** Ask kindly to all actors to die. Only the issuer will survive. */
   static void killAll();
 
-protected:
   /** Returns the internal implementation of this actor */
   simix::ActorImpl* getImpl();
 };
@@ -303,11 +290,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. */
-  int ppid();
+  /** @brief Returns the PPID of the current actor. */
+  XBT_PUBLIC(int) ppid();
+
+  /** @brief Returns the name of the current actor. */
+  XBT_PUBLIC(std::string) name();
 };
 
 /** @} */