![]() |
The Gaudi Framework
v26r4
|
Implementation of Gaudi::ISignalMonitor. More...


Public Types | |
| typedef struct sigaction | handler_t |
Public Types inherited from extends< BASE, Interfaces > | |
| typedef extends | base_class |
| Typedef to this class. More... | |
| typedef extend_interfaces< Interfaces...> | extend_interfaces_base |
| Typedef to the base of this class. More... | |
| typedef extends | base_class |
| Typedef to this class. More... | |
| typedef extend_interfaces< Interfaces...> | extend_interfaces_base |
| Typedef to the base of this class. More... | |
Public Types inherited from extend_interfaces< Interfaces...> | |
| using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type |
| take union of the ext_iids of all Interfaces... More... | |
| using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type |
| take union of the ext_iids of all Interfaces... More... | |
Public Member Functions | |
| void | monitorSignal (int signum, bool propagate) |
| Declare a signal to be monitored. More... | |
| void | ignoreSignal (int signum) |
| Remove the specific signal handler for the requested signal, restoring the previous signal handler. More... | |
| bool | gotSignal (int signum) const |
| Check if the given signal has been received. More... | |
| void | setSignal (int signum) |
| Set the flag for the given signal, as if the signal was received. More... | |
| void | clearSignal (int signum) |
| Clear the flag for the given signal, so that a new occurrence can be identified. More... | |
| SignalMonitorSvc (const std::string &name, ISvcLocator *svcLoc) | |
| Initialize internal variables of the service and set the instance pointer. More... | |
| virtual | ~SignalMonitorSvc () |
| Stop monitoring signals and clear the instance pointer. More... | |
Public Member Functions inherited from extends< BASE, Interfaces > | |
| void * | i_cast (const InterfaceID &tid) const override |
| Implementation of IInterface::i_cast. More... | |
| StatusCode | queryInterface (const InterfaceID &ti, void **pp) override |
| Implementation of IInterface::queryInterface. More... | |
| std::vector< std::string > | getInterfaceNames () const override |
| Implementation of IInterface::getInterfaceNames. More... | |
| ~extends () override=default | |
| Virtual destructor. More... | |
| void * | i_cast (const InterfaceID &tid) const override |
| Implementation of IInterface::i_cast. More... | |
| StatusCode | queryInterface (const InterfaceID &ti, void **pp) override |
| Implementation of IInterface::queryInterface. More... | |
| std::vector< std::string > | getInterfaceNames () const override |
| Implementation of IInterface::getInterfaceNames. More... | |
| ~extends () override=default | |
| Virtual destructor. More... | |
Public Member Functions inherited from extend_interfaces< Interfaces...> | |
| ~extend_interfaces () override=default | |
| Virtual destructor. More... | |
| ~extend_interfaces () override=default | |
| Virtual destructor. More... | |
Private Types | |
| enum | MonitoringMode { ignored, trap, propagate } |
| Possible monitoring modes. More... | |
Private Member Functions | |
| void | i_handle (int signum) |
Static Private Member Functions | |
| static void | setInstance (SignalMonitorSvc *i) |
| static SignalMonitorSvc * | instance () |
| Method to get the singleton instance. More... | |
| static void | dispatcher (int signum) |
| Signal handler function. More... | |
Private Attributes | |
| MonitoringMode | m_monitored [NSIG] |
| Array of flags to keep track of monitored signals. More... | |
| sig_atomic_t | m_caught [NSIG] |
| Array of flags for received signals. More... | |
| handler_t | m_defaultAction |
| Helper variable for default signal action. More... | |
| handler_t | m_oldActions [NSIG] |
| List of replaced signal actions (for the recovery when disable the monitoring). More... | |
Static Private Attributes | |
| static SignalMonitorSvc * | s_instance = nullptr |
| Pointer to the current instance. More... | |
Implementation of Gaudi::ISignalMonitor.
If instantiated, intercepts the system signals and keep track of the recorded ones.
The signal to be monitored have to be declared via the method monitorSignal(). It can be interrogated to check if a signal has been received.
Definition at line 26 of file SignalMonitorSvc.cpp.
| typedef struct sigaction Gaudi::Utils::SignalMonitorSvc::handler_t |
Definition at line 31 of file SignalMonitorSvc.cpp.
|
private |
Possible monitoring modes.
| Enumerator | |
|---|---|
| ignored | |
| trap | |
| propagate | |
Definition at line 112 of file SignalMonitorSvc.cpp.
|
inline |
Initialize internal variables of the service and set the instance pointer.
Definition at line 85 of file SignalMonitorSvc.cpp.
|
inlinevirtual |
Stop monitoring signals and clear the instance pointer.
Definition at line 103 of file SignalMonitorSvc.cpp.
|
inline |
Clear the flag for the given signal, so that a new occurrence can be identified.
Definition at line 80 of file SignalMonitorSvc.cpp.
|
staticprivate |
Signal handler function.
Definition at line 161 of file SignalMonitorSvc.cpp.
|
inline |
Check if the given signal has been received.
Definition at line 70 of file SignalMonitorSvc.cpp.
|
inlineprivate |
Definition at line 126 of file SignalMonitorSvc.cpp.
|
inline |
Remove the specific signal handler for the requested signal, restoring the previous signal handler.
Definition at line 57 of file SignalMonitorSvc.cpp.
|
inlinestaticprivate |
Method to get the singleton instance.
Bypass the serviceLocator for efficiency.
Definition at line 152 of file SignalMonitorSvc.cpp.
|
inline |
Declare a signal to be monitored.
It installs a signal handler for the requested signal.
Definition at line 36 of file SignalMonitorSvc.cpp.
|
inlinestaticprivate |
Definition at line 146 of file SignalMonitorSvc.cpp.
|
inline |
Set the flag for the given signal, as if the signal was received.
Definition at line 75 of file SignalMonitorSvc.cpp.
|
private |
Array of flags for received signals.
Definition at line 120 of file SignalMonitorSvc.cpp.
|
private |
Helper variable for default signal action.
Definition at line 122 of file SignalMonitorSvc.cpp.
|
private |
Array of flags to keep track of monitored signals.
Definition at line 118 of file SignalMonitorSvc.cpp.
|
private |
List of replaced signal actions (for the recovery when disable the monitoring).
Definition at line 124 of file SignalMonitorSvc.cpp.
|
staticprivate |
Pointer to the current instance.
Definition at line 144 of file SignalMonitorSvc.cpp.