X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/01b1b51804cac347d826333b3458fce5d6fb11fe..d4cc1617632cd9d23affa1338ba0bf7d4b0efd0e:/include/simgrid/s4u/Actor.hpp diff --git a/include/simgrid/s4u/Actor.hpp b/include/simgrid/s4u/Actor.hpp index 026b326dd4..fd9a6a4751 100644 --- a/include/simgrid/s4u/Actor.hpp +++ b/include/simgrid/s4u/Actor.hpp @@ -131,8 +131,6 @@ class XBT_PUBLIC Actor : public simgrid::xbt::Extendable { explicit Actor(smx_actor_t pimpl) : pimpl_(pimpl) {} - typedef std::function callback_type; - public: // ***** No copy ***** @@ -168,7 +166,7 @@ public: * * If the actor is restarted, the actor has a fresh copy of the function. */ - static ActorPtr create(std::string name, s4u::Host* host, callback_type code); + static ActorPtr create(std::string name, s4u::Host* host, std::function code); /** Create an actor from a std::function * @@ -176,7 +174,7 @@ public: */ template static ActorPtr create(std::string name, s4u::Host* host, F code) { - return create(name, host, callback_type(std::move(code))); + return create(name, host, std::function(std::move(code))); } /** Create an actor using a callable thing and its arguments. @@ -444,16 +442,18 @@ XBT_PUBLIC bool is_suspended(); /** @brief kill the actor. */ XBT_PUBLIC void exit(); -#ifndef DOXYGEN -/** @deprecated Please use std::function for first parameter */ -XBT_ATTRIB_DEPRECATED_v323("Please use std::function for first parameter.") XBT_PUBLIC - void on_exit(int_f_pvoid_pvoid_t fun, void* data); /** @brief Add a function to the list of "on_exit" functions. */ XBT_PUBLIC void on_exit(std::function fun, void* data); /** @brief Migrate the actor to a new host. */ XBT_PUBLIC void migrate(Host* new_host); +/** @} */ + +#ifndef DOXYGEN +/** @deprecated Please use std::function for first parameter */ +XBT_ATTRIB_DEPRECATED_v323("Please use std::function for first parameter.") XBT_PUBLIC + void on_exit(int_f_pvoid_pvoid_t fun, void* data); /** @deprecated See this_actor::get_name() */ XBT_ATTRIB_DEPRECATED_v323("Please use this_actor::get_name()") XBT_PUBLIC std::string getName(); /** @deprecated See this_actor::get_cname() */ @@ -475,7 +475,6 @@ XBT_ATTRIB_DEPRECATED_v324("Please use this_actor::exit()") XBT_PUBLIC void kill #endif } -/** @} */ }} // namespace simgrid::s4u