X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7238b7f58f04a7cc2dd9d9241c955dfa1f07611e..b8996c34869f8fbd6edf7556d7bef921e55962ba:/src/simix/ActorImpl.hpp diff --git a/src/simix/ActorImpl.hpp b/src/simix/ActorImpl.hpp index e4517b95fe..dcdea7a9d1 100644 --- a/src/simix/ActorImpl.hpp +++ b/src/simix/ActorImpl.hpp @@ -8,8 +8,10 @@ #include "simgrid/s4u/Actor.hpp" #include "src/simix/popping_private.h" +#include "src/surf/PropertyHolder.hpp" #include "xbt/swag.h" #include +#include typedef struct s_smx_process_exit_fun { int_f_pvoid_pvoid_t fun; @@ -27,11 +29,11 @@ public: void *data = nullptr; sg_host_t host = nullptr; double kill_time = 0.0; - xbt_dict_t properties = nullptr; + std::shared_ptr> properties; bool auto_restart = false; }; -class ActorImpl { +class ActorImpl : public simgrid::surf::PropertyHolder { public: ActorImpl() : piface_(this) {} ~ActorImpl(); @@ -59,9 +61,8 @@ public: sg_host_t new_host = nullptr; /* if not null, the host on which the process must migrate to */ smx_activity_t waiting_synchro = nullptr; /* the current blocking synchro if any */ std::list comms; /* the current non-blocking communication synchros */ - xbt_dict_t properties = nullptr; s_smx_simcall_t simcall; - void *data = nullptr; /* kept for compatibility, it should be replaced with moddata */ + void* userdata = nullptr; /* kept for compatibility, it should be replaced with moddata */ std::vector on_exit; /* list of functions executed when the process dies */ std::function code; @@ -106,10 +107,12 @@ public: void daemonize(); bool isDaemon() { return daemon; } /** Whether this actor has been daemonized */ bool isSuspended() { return suspended; } - ActorImpl* restart(ActorImpl* issuer); + simgrid::s4u::Actor* restart(); smx_activity_t suspend(ActorImpl* issuer); void resume(); smx_activity_t sleep(double duration); + void setUserData(void* data) { userdata = data; } + void* getUserData() { return userdata; } }; } @@ -121,13 +124,9 @@ typedef simgrid::simix::ActorImpl* smx_actor_t; SG_BEGIN_DECL() -XBT_PRIVATE smx_actor_t SIMIX_process_create( - const char *name, - std::function code, - void *data, - sg_host_t host, - xbt_dict_t properties, - smx_actor_t parent_process); +XBT_PRIVATE smx_actor_t SIMIX_process_create(const char* name, std::function code, void* data, sg_host_t host, + std::map* properties, + smx_actor_t parent_process); XBT_PRIVATE void SIMIX_process_runall(); XBT_PRIVATE void SIMIX_process_kill(smx_actor_t process, smx_actor_t issuer);