S4U_Daemon.h
void releaseDaemonLock()
Unlock the daemon's lock.
Definition: S4U_Daemon.cpp:356
bool hasReturnedFromMain()
Returns true if the daemon has returned from main() (i.e., not brutally killed)
Definition: S4U_Daemon.cpp:315
UP state: the daemon has been started and is still running.
Definition: S4U_Daemon.h:92
void setupOnExitFunction()
Sets up the on_exit functionf for the actor.
Definition: S4U_Daemon.cpp:205
std::string initial_mailbox_name
The initial name of the daemon's mailbox.
Definition: S4U_Daemon.h:47
void acquireDaemonLock()
Lock the daemon's lock.
Definition: S4U_Daemon.cpp:349
void killActor()
Kill the daemon/actor (does nothing if already dead)
Definition: S4U_Daemon.cpp:263
std::string process_name
The name of the daemon.
Definition: S4U_Daemon.h:45
std::string getName()
Retrieve the process name.
Definition: S4U_Daemon.cpp:331
LifeSaver * life_saver
The daemon's life saver.
Definition: S4U_Daemon.h:102
std::string mailbox_name
The current name of the daemon's mailbox.
Definition: S4U_Daemon.h:49
bool isSetToAutoRestart()
Return the auto-restart status of the daemon.
Definition: S4U_Daemon.cpp:231
unsigned int num_starts
The number of time that this daemon has started (i.e., 1 + number of restarts)
Definition: S4U_Daemon.h:121
std::pair< bool, int > join()
Join (i.e., wait for) the daemon.
Definition: S4U_Daemon.cpp:300
int getReturnValue()
Returns the value returned by main() (if the daemon has returned from main)
Definition: S4U_Daemon.cpp:323
void runMainMethod()
Method that run's the user-defined main method (that's called by the S4U actor class) ...
Definition: S4U_Daemon.cpp:246
std::string hostname
The name of the host on which the daemon is running.
Definition: S4U_Daemon.h:51
A class that provides basic simulation methods. Once the simulation object has been explicitly or imp...
Definition: Simulation.h:45
The S4U actor that's the foundation for the S4U_Daemon abstraction.
Definition: S4U_DaemonActor.h:36
virtual void cleanup(bool has_returned_from_main, int return_value)
Cleanup function called when the daemon terminates (for whatever reason). The default behavior is to ...
Definition: S4U_Daemon.cpp:112
S4U_Daemon(std::string hostname, std::string process_name_prefix, std::string mailbox_prefix)
Constructor (daemon with a mailbox)
Definition: S4U_Daemon.cpp:37
void resumeActor()
Resume the daemon/actor.
Definition: S4U_Daemon.cpp:288
S4U_Daemon::State getState()
Get the daemon's state.
Definition: S4U_Daemon.cpp:126
Simulation * simulation
a pointer to the simulation object
Definition: S4U_Daemon.h:105
A generic "running daemon" abstraction that serves as a basis for all simulated processes.
Definition: S4U_Daemon.h:32
void startDaemon(bool daemonized, bool auto_restart)
Start the daemon.
Definition: S4U_Daemon.cpp:139
void createLifeSaver(std::shared_ptr< S4U_Daemon > reference)
Create a life saver for the daemon.
Definition: S4U_Daemon.cpp:339
Definition: Alarm.cpp:19
DOWN state: the daemon has been shutdown and/or has terminated.
Definition: S4U_Daemon.h:94
bool isDaemonized()
Return the daemonized status of the daemon.
Definition: S4U_Daemon.cpp:239
SUSPENDED state: the daemon has been suspended (and hopefully will be resumed0.
Definition: S4U_Daemon.h:96
void suspendActor()
Suspend the daemon/actor.
Definition: S4U_Daemon.cpp:279