libDwm-0.6.0
Dwm::Signal Class Reference

This class encapsulates a signal. More...

#include <DwmSignal.hh>

Inheritance diagram for Dwm::Signal:

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. More...
 
int PushHandler (void(*handler)(int))
 Pushes a signal onto the top of a stack of signal handlers for the signal. More...
 
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").
 

Static Protected Member Functions

static void FillNames ()
 

Protected Attributes

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

Static Protected Attributes

static 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(*)(int)  handler)

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: