- this->pimpl_ = SIMIX_process_ref(simcall_process_create(
- name, std::move(code), nullptr, host->name().c_str(),
- killTime, nullptr, 0));
+ simgrid::simix::ActorImpl* actor = simcall_process_create(name, std::move(code), nullptr, host, nullptr);
+ return actor->iface();
+}
+
+void intrusive_ptr_add_ref(Actor* actor)
+{
+ xbt_assert(actor != nullptr);
+ intrusive_ptr_add_ref(actor->pimpl_);
+}
+void intrusive_ptr_release(Actor* actor)
+{
+ xbt_assert(actor != nullptr);
+ intrusive_ptr_release(actor->pimpl_);
+}
+
+// ***** Actor methods *****
+
+void Actor::join() {
+ simcall_process_join(this->pimpl_, -1);
+}
+
+void Actor::setAutoRestart(bool autorestart) {
+ simgrid::simix::kernelImmediate([this, autorestart]() { pimpl_->auto_restart = autorestart; });
+}
+
+void Actor::onExit(int_f_pvoid_pvoid_t fun, void* data)
+{
+ simcall_process_on_exit(pimpl_, fun, data);
+}
+
+void Actor::migrate(Host* new_host)
+{
+ simgrid::simix::kernelImmediate([this, new_host]() { pimpl_->new_host = new_host; });
+}
+
+s4u::Host* Actor::getHost()
+{
+ return this->pimpl_->host;
+}
+
+void Actor::daemonize()
+{
+ simgrid::simix::kernelImmediate([this]() { pimpl_->daemonize(); });
+}
+
+const char* Actor::getCname()
+{
+ return this->pimpl_->name.c_str();
+}
+
+simgrid::xbt::string Actor::getName()
+{
+ return this->pimpl_->name;