X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e55e975804ae9c6ec82a5fbac2c7ea2497757a28..7441fa1d1bbb15703c9d65f07ed250edafbaff78:/include/simgrid/simix.hpp diff --git a/include/simgrid/simix.hpp b/include/simgrid/simix.hpp index 99d241054f..d08f865bfe 100644 --- a/include/simgrid/simix.hpp +++ b/include/simgrid/simix.hpp @@ -13,10 +13,10 @@ #include #include #include -#include #include #include +#include #include @@ -171,6 +171,14 @@ public: XBT_PUBLIC(void) set_maestro(std::function code); XBT_PUBLIC(void) create_maestro(std::function code); +// What's executed as SIMIX actor code: +typedef std::function ActorCode; + +// Create ActorCode based on argv: +typedef std::function args)> ActorCodeFactory; + +XBT_PUBLIC(void) registerFunction(const char* name, ActorCodeFactory factory); + } } @@ -206,12 +214,12 @@ XBT_PUBLIC(smx_process_t) simcall_process_create(const char *name, xbt_dict_t properties, int auto_restart); -XBT_PUBLIC(smx_timer_t) SIMIX_timer_set(double date, std::packaged_task callback); +XBT_PUBLIC(smx_timer_t) SIMIX_timer_set(double date, simgrid::xbt::Task callback); template inline XBT_PUBLIC(smx_timer_t) SIMIX_timer_set(double date, F callback) { - return SIMIX_timer_set(date, std::packaged_task(std::move(callback))); + return SIMIX_timer_set(date, simgrid::xbt::Task(std::move(callback))); } template inline