virtual int main(int argc, char **argv);
/** The Actor that is currently running */
- static Actor *current();
+ static Actor &self();
/** Retrieves the actor that have the given PID (or NULL if not existing) */
//static Actor *byPid(int pid); not implemented
fprintf(stderr,"Error: You should override the method main(int, char**) in Actor class %s\n",getName());
return 0;
}
-s4u::Actor *s4u::Actor::current()
+s4u::Actor &s4u::Actor::self()
{
smx_process_t smx_proc = SIMIX_process_self();
simgrid::s4u::Actor* res = (simgrid::s4u::Actor*) SIMIX_process_self_get_data();
if (res == NULL) // The smx_process was not created by S4U (but by deployment?). Embed it in a S4U object
res = new Actor(smx_proc);
- return res;
+ return *res;
}
void s4u::Actor::setAutoRestart(bool autorestart) {