libDwm-0.9.45
Dwm::Signal Class Reference

This class encapsulates a signal. More...

#include <DwmSignal.hh>

Public Member Functions

 Signal (int sigNum)
 Construct from a signal number (e.g. SIGHUP).
 
 Signal (const Signal &signal)
 Copy constructor.
 
bool Block ()
 Block the signal.
 
bool Unblock ()
 Unblock the signal.
 
bool IsBlocked ()
 Returns true if the signal is currently blocked.
 
bool IsPending ()
 Returns true if the signal is currently pending.
 
void Wait ()
 Waits for the delivery of the signal to the calling thread.
 
int PushHandler (void(*handler)(int))
 Pushes a signal onto the top of a stack of signal handlers for the signal.
 
int PopHandler ()
 Pops the top signal handler off of the stack of signal handlers.
 
const std::string & Name () const
 Returns a string representation of the signal ("e.g. "SIGHUP").
 

Protected Attributes

int _sigNum
 
std::deque< void(*)(int)> _handlers
 

Static Protected Attributes

static const std::map< int, std::string, std::less< int > > _names
 

Detailed Description

This class encapsulates a signal.

Member Function Documentation

◆ PushHandler()

int Dwm::Signal::PushHandler ( void(* handler )(int))

Pushes a signal onto the top of a stack of signal handlers for the signal.

The handler on the top of the stack is the one which will be called on reception of the signal.

◆ Wait()

void Dwm::Signal::Wait ( )

Waits for the delivery of the signal to the calling thread.

See the sigwait() manpage.


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