libmoost
moost::process::hup_handler Class Reference

#include <hup_handler.hpp>

List of all members.

Public Types

typedef boost::function< void()> handler_t

Static Public Member Functions

static void set (handler_t const &handler)

Private Member Functions

void register_handler ()

Static Private Member Functions

static hup_handlerget_single_instance ()
static void sighandler (int)

Private Attributes

handler_t handler_
struct sigaction sa_

Detailed Description

This class represent and very simple way to trap and handle hang-up signals. It is not and never was intended to be a fully fledged signal handling framework. It's only job in life is to allow you to register a handler (which can be a simple free standing function or a functor), which will be called if the posix standard SIGHUP signal is raised.

The default behaviour that a process should implement is to reload the configuration file and then use any changes found.

To use it just call it from an appropirate place in your main thread before you start any services or actions that might need clearing up on termination. It is up to you to ensure your custom handler shuts down your process. The normal action of termination will be disabled.

Definition at line 52 of file hup_handler.hpp.


Member Typedef Documentation

typedef boost::function<void ()> moost::process::hup_handler::handler_t

Definition at line 63 of file hup_handler.hpp.


Member Function Documentation

static hup_handler& moost::process::hup_handler::get_single_instance ( ) [inline, static, private]

Definition at line 56 of file hup_handler.hpp.

Here is the caller graph for this function:

Definition at line 89 of file hup_handler.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

static void moost::process::hup_handler::set ( handler_t const &  handler) [inline, static]

Definition at line 66 of file hup_handler.hpp.

Here is the call graph for this function:

static void moost::process::hup_handler::sighandler ( int  ) [inline, static, private]

Definition at line 77 of file hup_handler.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 74 of file hup_handler.hpp.

struct sigaction moost::process::hup_handler::sa_ [private]

Definition at line 88 of file hup_handler.hpp.


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