SigFn
Loading...
Searching...
No Matches
sigfn Namespace Reference

Typedefs

typedef std::function< void(int)> handler_function
 signal handler function object type
 

Functions

DLL_EXPORT void handle (int signum, const handler_function &handler_function)
 attach handler to specific signal using copy semantics
 
DLL_EXPORT void handle (int signum, handler_function &&handler_function)
 attach handler to specific signal using move semantics
 
DLL_EXPORT void ignore (int signum)
 ignore a specific signal
 
DLL_EXPORT void reset (int signum)
 reset a specific signal to its default behavior
 
DLL_EXPORT int wait (std::initializer_list< int > signums)
 wait for any signal in the list
 
DLL_EXPORT std::optional< int > wait_for (std::initializer_list< int > signums, const std::chrono::system_clock::duration &timeout)
 wait for any signal in the list with a timeout
 
DLL_EXPORT std::optional< int > wait_until (std::initializer_list< int > signums, const std::chrono::system_clock::time_point &deadline)
 wait for any signal in the list until a deadline
 

Typedef Documentation

◆ handler_function

typedef std::function<void(int)> sigfn::handler_function

signal handler function object type

Parameters
signumsignal number

Function Documentation

◆ handle() [1/2]

DLL_EXPORT void sigfn::handle ( int signum,
const handler_function & handler_function )

attach handler to specific signal using copy semantics

Parameters
signumsignal to be handled
handler_functionfunction object associated with this signal

◆ handle() [2/2]

DLL_EXPORT void sigfn::handle ( int signum,
handler_function && handler_function )

attach handler to specific signal using move semantics

Parameters
signumsignal to be handled
handler_functionfunction object associated with this signal

◆ ignore()

DLL_EXPORT void sigfn::ignore ( int signum)

ignore a specific signal

Parameters
signumsignal to be ignored

◆ reset()

DLL_EXPORT void sigfn::reset ( int signum)

reset a specific signal to its default behavior

Parameters
signumsignal to be reset

◆ wait()

DLL_EXPORT int sigfn::wait ( std::initializer_list< int > signums)

wait for any signal in the list

Parameters
signumslist of signals to wait for
Returns
signal number

◆ wait_for()

DLL_EXPORT std::optional< int > sigfn::wait_for ( std::initializer_list< int > signums,
const std::chrono::system_clock::duration & timeout )

wait for any signal in the list with a timeout

Parameters
signumslist of signals to wait for
timeoutduration to wait
Returns
signal number if received before timeout

◆ wait_until()

DLL_EXPORT std::optional< int > sigfn::wait_until ( std::initializer_list< int > signums,
const std::chrono::system_clock::time_point & deadline )

wait for any signal in the list until a deadline

Parameters
signumslist of signals to wait for
deadlinetime point to wait until
Returns
signal number if received before deadline