LogCabin
|
A Signal is called by the Event::Loop when a Unix signal is received. More...
#include <Signal.h>
Classes | |
class | Blocker |
Blocks asynchronous signal delivery on the current thread for the given signal. More... | |
class | Monitor |
Registers a Signal handler to be monitored by the Event::Loop. More... | |
Public Member Functions | |
Signal (int signalNumber) | |
Construct a signal handler. | |
virtual | ~Signal () |
Destructor. | |
virtual void | handleSignalEvent ()=0 |
This method is overridden by a subclass and invoked when the signal is received. | |
Public Attributes | |
const int | signalNumber |
The signal number identifying which signal to receive (man signal.h). | |
Private Member Functions | |
void | handleFileEvent (uint32_t events) |
Generic event handler for files. | |
Signal (const Signal &) | |
Signal & | operator= (const Signal &) |
A Signal is called by the Event::Loop when a Unix signal is received.
The client should inherit from this and implement the handleSignalEvent() method for when the signal is received. This is persistent; it will handle repeated delivery of the signal.
Signal handlers can be created from any thread, but they will always fire on the thread running the Event::Loop.
LogCabin::Event::Signal::Signal | ( | int | signalNumber | ) | [explicit] |
LogCabin::Event::Signal::~Signal | ( | ) | [virtual] |
LogCabin::Event::Signal::Signal | ( | const Signal & | ) | [private] |
virtual void LogCabin::Event::Signal::handleSignalEvent | ( | ) | [pure virtual] |
This method is overridden by a subclass and invoked when the signal is received.
This method will be invoked by the main event loop on whatever thread is running the Event::Loop.
Implemented in LogCabin::Server::ServerStats::SignalHandler, LogCabin::Server::Globals::LogRotateHandler, and LogCabin::Server::Globals::ExitHandler.
void LogCabin::Event::Signal::handleFileEvent | ( | uint32_t | events | ) | [private, virtual] |
const int LogCabin::Event::Signal::signalNumber |