+namespace simgrid {
+namespace s4u {
+
+// ***** Actor creation *****
+ActorPtr Actor::self()
+{
+ smx_context_t self_context = SIMIX_context_self();
+ if (self_context == nullptr)
+ return simgrid::s4u::ActorPtr();
+
+ return simgrid::s4u::ActorPtr(&self_context->process()->getIface());
+}
+
+ActorPtr Actor::createActor(const char* name, s4u::Host* host, std::function<void()> code)
+{
+ smx_actor_t actor = simcall_process_create(name, std::move(code), nullptr, host, nullptr);
+ return ActorPtr(&actor->getIface());
+}