Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git://scm.gforge.inria.fr/simgrid/simgrid
[simgrid.git] / include / simgrid / s4u / actor.hpp
index 4476f5e..f807407 100644 (file)
@@ -6,15 +6,13 @@
 #ifndef SIMGRID_S4U_ACTOR_HPP
 #define SIMGRID_S4U_ACTOR_HPP
 
-#include "simgrid/simix.h"
+#include <xbt/base.h>
+#include <simgrid/simix.h>
+#include <simgrid/s4u/forward.hpp>
 
 namespace simgrid {
 namespace s4u {
 
-class Comm;
-class Host;
-class Mailbox;
-
 /** @brief Simulation Agent
  *
  * An actor may be defined as a code executing in a location (host).
@@ -39,15 +37,16 @@ class Mailbox;
  * \endverbatim
  *
  */
-class Actor {
+XBT_PUBLIC_CLASS Actor {
        friend Comm;
+       Actor(smx_process_t smx_proc);
 public:
        Actor(const char*name, s4u::Host *host, int argc, char **argv);
        Actor(const char*name, s4u::Host *host, int argc, char **argv, double killTime);
        virtual ~Actor() {}
 
        /** The main method of your agent */
-       virtual int main(int argc, char **argv)=0;
+       virtual int main(int argc, char **argv);
 
        /** The Actor that is currently running */
        static Actor *current();
@@ -81,17 +80,20 @@ public:
        void sleep(double duration);
 
        /** Block the actor, computing the given amount of flops */
-       void execute(double flop);
+       e_smx_state_t execute(double flop);
 
-       /** Block the actor until it gets a message from the given mailbox */
+       /** Block the actor until it gets a message from the given mailbox.
+        *
+        * See \ref Comm for the full communication API (including non blocking communications).
+        */
        void *recv(Mailbox &chan);
 
-       /** Block the actor until it delivers a message of the given simulated size to the given mailbox */
+       /** Block the actor until it delivers a message of the given simulated size to the given mailbox
+        *
+        * See \ref Comm for the full communication API (including non blocking communications).
+       */
        void send(Mailbox &chan, void*payload, size_t simulatedSize);
 
-       /** Creates (but don't start) an async send action */
-       Comm &send_init(Mailbox &chan);
-
 protected:
        smx_process_t getInferior() {return p_smx_process;}
 private: