powerd++  0.4.4
Public Member Functions | Private Attributes | List of all members
sys::sig::Signal Class Reference

Sets up a given signal handler and restores the old handler when going out of scope. More...

#include <signal.hpp>

Public Member Functions

 Signal (int const sig, sig_t const handler)
 Sets up the given handler. More...
 
 ~Signal ()
 Restore previous signal handler.
 

Private Attributes

const int sig
 The signal this handler is handling.
 
const sig_t handler
 The previous signal handler.
 

Detailed Description

Sets up a given signal handler and restores the old handler when going out of scope.

Constructor & Destructor Documentation

◆ Signal()

sys::sig::Signal::Signal ( int const  sig,
sig_t const  handler 
)
inline

Sets up the given handler.

Parameters
sigThe signal to set a handler for
handlerThe signal handling function
Exceptions
sys::sc_error<error>Throws with the errno of signal()

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