#include <map>
struct s_smx_process_exit_fun_t {
- std::function<void(int, void*)> fun;
+ std::function<void(bool, void*)> fun;
void *arg;
};
namespace kernel {
namespace actor {
-class ActorImpl : public surf::PropertyHolder {
+class XBT_PUBLIC ActorImpl : public surf::PropertyHolder {
s4u::Host* host_ = nullptr; /* the host on which the actor is running */
void* userdata_ = nullptr; /* kept for compatibility, it should be replaced with moddata */
aid_t pid_ = 0;
public:
xbt::string name_;
ActorImpl(xbt::string name, s4u::Host* host);
+ ActorImpl(const ActorImpl&) = delete;
+ ActorImpl& operator=(const ActorImpl&) = delete;
~ActorImpl();
double get_kill_time();
std::vector<s_smx_process_exit_fun_t> on_exit; /* list of functions executed when the process dies */
std::function<void()> code;
- smx_timer_t kill_timer = nullptr;
+ simix::Timer* kill_timer = nullptr;
private:
/* Refcounting */
static ActorImplPtr create(std::string name, simix::ActorCode code, void* data, s4u::Host* host,
std::unordered_map<std::string, std::string>* properties, ActorImpl* parent_actor);
+ static ActorImplPtr attach(std::string name, void* data, s4u::Host* host,
+ std::unordered_map<std::string, std::string>* properties);
+ static void detach();
void cleanup();
void exit();
void kill(ActorImpl* actor);