Fawkes API
Fawkes Development Version
|
System signal manager. More...
#include <utils/system/signal.h>
Static Public Member Functions | |
static SignalManager * | instance () |
Get the SignalManager instance. More... | |
static void | finalize () |
Finalize (and free) the SignalManager instance, this does NOT implicitly delete the signal handlers, you have to do this by yourself. More... | |
static SignalHandler * | register_handler (int signum, SignalHandler *handler) |
Register a SignalHandler for a signal. More... | |
static void | unregister_handler (int signum) |
Unregister a SignalHandler for a signal. More... | |
static void | unregister_handler (SignalHandler *handler) |
Unregister a SignalHandler for a signal. More... | |
static void | ignore (int signum) |
Ignore a signal. More... | |
System signal manager.
This class dispatches signals received from the system to the appropriate handlers or sets a signal to be ignored. This class is never instantiated but rather you just register a handler. After you are done with signal handling call finalize() to free the use resources and de-register all signal handlers at once.
|
static |
Finalize (and free) the SignalManager instance, this does NOT implicitly delete the signal handlers, you have to do this by yourself.
Definition at line 98 of file signal.cpp.
|
static |
Ignore a signal.
signum | The signal number from <signal.h> |
Definition at line 182 of file signal.cpp.
References fawkes::SignalHandler::handle_signal().
Referenced by fawkes::FawkesMainThread::Runner::Runner().
|
static |
Get the SignalManager instance.
Definition at line 81 of file signal.cpp.
|
static |
Register a SignalHandler for a signal.
signum | The signal number from <signal.h> |
handler | The SignalHandler that should handle this event |
Definition at line 116 of file signal.cpp.
Referenced by JoystickBlackBoardActListener::bb_interface_message_received(), and fawkes::FawkesMainThread::Runner::Runner().
|
static |
Unregister a SignalHandler for a signal.
signum | The signal number from <signal.h> |
Definition at line 140 of file signal.cpp.
Referenced by fawkes::FawkesMainThread::Runner::~Runner().
|
static |
Unregister a SignalHandler for a signal.
handler | The SignalHandler you want to unregister, will unregister all signals this handler was registered for |
Definition at line 151 of file signal.cpp.