X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4d02714ee138a3bd9b02e0064b7a2aa26407e9e8..a49dc3ed413f7a3ac4a03fb7593bdbebf3f19f5b:/include/simgrid/s4u/Actor.hpp diff --git a/include/simgrid/s4u/Actor.hpp b/include/simgrid/s4u/Actor.hpp index 2b85f6db75..f3d91d1aff 100644 --- a/include/simgrid/s4u/Actor.hpp +++ b/include/simgrid/s4u/Actor.hpp @@ -169,6 +169,8 @@ public: * If the actor is restarted, the actor has a fresh copy of the function. */ static ActorPtr create(std::string name, s4u::Host* host, std::function code); + static ActorPtr init(std::string name, s4u::Host* host); + ActorPtr start(std::function code); /** Create an actor from a std::function * @@ -234,7 +236,7 @@ public: * It will be set to true if the actor was killed or failed because of an exception, * while it will remain to false if the actor terminated gracefully. */ - void on_exit(std::function fun); + void on_exit(const std::function& fun); /** Sets the time at which that actor should be killed */ void set_kill_time(double time); @@ -293,8 +295,8 @@ public: void set_property(const std::string& key, std::string value); #ifndef DOXYGEN - XBT_ATTRIB_DEPRECATED_v325("Please use Actor::on_exit(fun) instead") void on_exit(std::function fun, - void* data); + XBT_ATTRIB_DEPRECATED_v325("Please use Actor::on_exit(fun) instead") void on_exit( + const std::function& fun, void* data); XBT_ATTRIB_DEPRECATED_v325("Please use Actor::by_pid(pid).kill() instead") static void kill(aid_t pid); @@ -496,6 +498,9 @@ XBT_ATTRIB_DEPRECATED_v325("Please use std::vectors as parameters") XBT_PUBLIC #endif XBT_PUBLIC ExecPtr exec_init(double flops_amounts); +XBT_PUBLIC ExecPtr exec_init(const std::vector& hosts, const std::vector& flops_amounts, + const std::vector& bytes_amounts); + XBT_PUBLIC ExecPtr exec_async(double flops_amounts); /** @brief Returns the actor ID of the current actor. */ @@ -538,7 +543,7 @@ XBT_PUBLIC void exit(); * while it will remain to false if the actor terminated gracefully. */ -XBT_PUBLIC void on_exit(std::function fun); +XBT_PUBLIC void on_exit(const std::function& fun); /** @brief Migrate the current actor to a new host. */ XBT_PUBLIC void migrate(Host* new_host); @@ -547,7 +552,7 @@ XBT_PUBLIC void migrate(Host* new_host); #ifndef DOXYGEN XBT_ATTRIB_DEPRECATED_v325("Please use std::function for first parameter.") XBT_PUBLIC - void on_exit(std::function fun, void* data); + void on_exit(const std::function& fun, void* data); /** @deprecated Please use std::function for first parameter */ XBT_ATTRIB_DEPRECATED_v323("Please use std::function for first parameter.") XBT_PUBLIC