Fawkes API  Fawkes Development Version
fawkes::SignalManager Class Reference

#include <utils/system/signal.h>

Static Public Member Functions

static SignalManagerinstance ()
 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 SignalHandlerregister_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...
 

Detailed Description

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.

Author
Tim Niemueller

Definition at line 54 of file signal.h.

Member Function Documentation

◆ finalize()

void fawkes::SignalManager::finalize ( )
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 106 of file signal.cpp.

◆ ignore()

void fawkes::SignalManager::ignore ( int  signum)
static

Ignore a signal.

Parameters
signumThe signal number from <signal.h>

Definition at line 184 of file signal.cpp.

◆ instance()

SignalManager * fawkes::SignalManager::instance ( )
static

Get the SignalManager instance.

Returns
SignalManager instance

Definition at line 90 of file signal.cpp.

◆ register_handler()

SignalHandler * fawkes::SignalManager::register_handler ( int  signum,
SignalHandler handler 
)
static

Register a SignalHandler for a signal.

Parameters
signumThe signal number from <signal.h>
handlerThe SignalHandler that should handle this event
Returns
The SignalManager registered before, maybe NULL if there was none

Definition at line 123 of file signal.cpp.

◆ unregister_handler() [1/2]

void fawkes::SignalManager::unregister_handler ( int  signum)
static

Unregister a SignalHandler for a signal.

Parameters
signumThe signal number from <signal.h>

Definition at line 146 of file signal.cpp.

◆ unregister_handler() [2/2]

void fawkes::SignalManager::unregister_handler ( SignalHandler handler)
static

Unregister a SignalHandler for a signal.

Parameters
handlerThe SignalHandler you want to unregister, will unregister all signals this handler was registered for

Definition at line 156 of file signal.cpp.


The documentation for this class was generated from the following files: