- // TODO, replace with boost intrusive container hooks
- s_xbt_swag_hookup_t process_hookup = { nullptr, nullptr }; /* simix_global->process_list */
- s_xbt_swag_hookup_t synchro_hookup = { nullptr, nullptr }; /* {mutex,cond,sem}->sleeping */
- s_xbt_swag_hookup_t host_proc_hookup = { nullptr, nullptr }; /* smx_host->process_lis */
- s_xbt_swag_hookup_t destroy_hookup = { nullptr, nullptr }; /* simix_global->process_to_destroy */
-
- aid_t pid = 0;
- aid_t ppid = -1;
- simgrid::xbt::string name;
- const simgrid::xbt::string& getName() const { return name; }
- const char* getCname() const { return name.c_str(); }
- s4u::Host* host = nullptr; /* the host on which the process is running */
- smx_context_t context = nullptr; /* the context (uctx/raw/thread) that executes the user function */
-
- // TODO, pack them
- std::exception_ptr exception;
- bool finished = false;
- bool blocked = false;
- bool suspended = false;
- bool auto_restart = false;
-
- 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<smx_activity_t> comms; /* the current non-blocking communication synchros */
- s_smx_simcall_t simcall;
- void* userdata = nullptr; /* kept for compatibility, it should be replaced with moddata */
+ double get_kill_time();
+ void set_kill_time(double kill_time);
+ boost::intrusive::list_member_hook<> host_process_list_hook; /* simgrid::simix::Host::process_list */
+ boost::intrusive::list_member_hook<> smx_destroy_list_hook; /* simix_global->actors_to_destroy */
+ boost::intrusive::list_member_hook<> smx_synchro_hook; /* {mutex,cond,sem}->sleeping */
+
+ const xbt::string& get_name() const { return name_; }
+ const char* get_cname() const { return name_.c_str(); }
+
+ // Accessors to private fields
+ s4u::Host* get_host() { return host_; }
+ void set_host(s4u::Host* dest);
+ void* get_user_data() { return userdata_; }
+ void set_user_data(void* data) { userdata_ = data; }
+ aid_t get_pid() const { return pid_; }
+ aid_t get_ppid() const { return ppid_; }
+ void set_ppid(aid_t ppid) { ppid_ = ppid; }
+ bool is_daemon() { return daemon_; } /** Whether this actor has been daemonized */
+ bool has_to_auto_restart() { return auto_restart_; }
+ void set_auto_restart(bool autorestart) { auto_restart_ = autorestart; }
+
+ context::Context* context_ = nullptr; /* the context (uctx/raw/thread) that executes the user function */
+
+ std::exception_ptr exception_;
+ bool finished_ = false;
+ bool blocked_ = false; /* FIXME this field is never set to true. Either use it or remove it. */
+ bool suspended_ = false;
+
+ activity::ActivityImplPtr waiting_synchro = nullptr; /* the current blocking synchro if any */
+ std::list<activity::ActivityImplPtr> comms; /* the current non-blocking communication synchros */
+ s_smx_simcall simcall;