X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0983afc2177fdd196cd4a9d0945d842dc5351abd..a23283368258c196be2e66730a7d691f313ef315:/include/simgrid/s4u/actor.hpp diff --git a/include/simgrid/s4u/actor.hpp b/include/simgrid/s4u/actor.hpp index bcfff139e3..d59ad63348 100644 --- a/include/simgrid/s4u/actor.hpp +++ b/include/simgrid/s4u/actor.hpp @@ -6,7 +6,8 @@ #ifndef SIMGRID_S4U_ACTOR_HPP #define SIMGRID_S4U_ACTOR_HPP -#include "simgrid/simix.h" +#include +#include namespace simgrid { namespace s4u { @@ -39,7 +40,7 @@ class Mailbox; * \endverbatim * */ -class Actor { +XBT_PUBLIC_CLASS Actor { friend Comm; Actor(smx_process_t smx_proc); public: @@ -48,7 +49,7 @@ public: virtual ~Actor() {} /** The main method of your agent */ - int main(int argc, char **argv) {return 0;} + virtual int main(int argc, char **argv); /** The Actor that is currently running */ static Actor *current(); @@ -84,15 +85,18 @@ public: /** Block the actor, computing the given amount of flops */ 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: