simgrid::simix::simcall([this, fun, data] { SIMIX_process_on_exit(pimpl_, fun, data); });
}
+void Actor::on_exit(std::function<void(int, void*)> fun, void* data)
+{
+ simgrid::simix::simcall([this, fun, data] { SIMIX_process_on_exit(pimpl_, fun, data); });
+}
+
/** @brief Moves the actor to another host
*
* If the actor is currently blocked on an execution activity, the activity is also
std::map<std::string, std::string>* Actor::get_properties()
{
- return simgrid::simix::simcall([this] { return this->pimpl_->getProperties(); });
+ return simgrid::simix::simcall([this] { return this->pimpl_->get_properties(); });
}
/** Retrieve the property value (or nullptr if not set) */
const char* Actor::get_property(const char* key)
{
- return simgrid::simix::simcall([this, key] { return pimpl_->getProperty(key); });
+ return simgrid::simix::simcall([this, key] { return pimpl_->get_property(key); });
}
void Actor::set_property(const char* key, const char* value)
{
- simgrid::simix::simcall([this, key, value] { pimpl_->setProperty(key, value); });
+ simgrid::simix::simcall([this, key, value] { pimpl_->set_property(key, value); });
}
Actor* Actor::restart()
SIMIX_process_self()->iface()->on_exit(fun, data);
}
+void on_exit(std::function<void(int, void*)> fun, void* data)
+{
+ SIMIX_process_self()->iface()->on_exit(fun, data);
+}
+
/** @brief Moves the current actor to another host
*
* @see simgrid::s4u::Actor::migrate() for more information
return actor->restart();
}
+/**
+ * \ingroup m_actor_management
+ * \brief Sets the "auto-restart" flag of the actor.
+ * If the flag is set to 1, the actor will be automatically restarted when its host comes back up.
+ */
+void sg_actor_set_auto_restart(sg_actor_t actor, int auto_restart)
+{
+ actor->set_auto_restart(auto_restart);
+}
+
/** @ingroup m_actor_management
* @brief This actor will be terminated automatically when the last non-daemon actor finishes
*/