X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/30cfe4a29c017ea6c8f05873dbeeb66a535cb152..867ccc79a341c1c4960c934dd76d68df4c6fabb6:/include/simgrid/s4u/actor.hpp diff --git a/include/simgrid/s4u/actor.hpp b/include/simgrid/s4u/actor.hpp index b34a8e9bce..b8463e643f 100644 --- a/include/simgrid/s4u/actor.hpp +++ b/include/simgrid/s4u/actor.hpp @@ -41,13 +41,14 @@ class Mailbox; */ 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,16 +82,19 @@ 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 string message (that will be copied) to the given mailbox */ - void sendstr(Mailbox &chan, const char*msg); - - /** Creates (but don't start) an async send action */ - Comm &send_init(Mailbox &chan); + /** 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); protected: smx_process_t getInferior() {return p_smx_process;}