LogCabin
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Member Functions | Public Attributes | Private Member Functions
LogCabin::Event::Signal Class Reference

A Signal is called by the Event::Loop when a Unix signal is received. More...

#include <Signal.h>

Inheritance diagram for LogCabin::Event::Signal:
LogCabin::Event::File LogCabin::Server::Globals::ExitHandler LogCabin::Server::Globals::LogRotateHandler LogCabin::Server::ServerStats::SignalHandler

List of all members.

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 &)
Signaloperator= (const Signal &)

Detailed Description

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.

Definition at line 37 of file Signal.h.


Constructor & Destructor Documentation

LogCabin::Event::Signal::Signal ( int  signalNumber) [explicit]

Construct a signal handler.

See also Blocker, which you'll generally need to create first, and Monitor, which you'll need to create after.

Parameters:
signalNumberThe signal number identifying which signal to receive (man signal.h).

Definition at line 119 of file Signal.cc.

Destructor.

Definition at line 125 of file Signal.cc.

LogCabin::Event::Signal::Signal ( const Signal ) [private]

Member Function Documentation

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]

Generic event handler for files.

Calls handleSignalEvent().

Implements LogCabin::Event::File.

Definition at line 130 of file Signal.cc.

Signal& LogCabin::Event::Signal::operator= ( const Signal ) [private]

Member Data Documentation

The signal number identifying which signal to receive (man signal.h).

Definition at line 127 of file Signal.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines