Loading...
Searching...
No Matches
SigHandlers.h
Go to the documentation of this file.
// -*- c++ -*-
//------------------------------------------------------------------------------
// SigHandlers.h
//------------------------------------------------------------------------------
// Copyright (C) 1997-2002 Vladislav Grinchenko
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//------------------------------------------------------------------------------
#ifndef _SigHandlers_h
#define _SigHandlers_h
// System includes
//
#include <signal.h>
#include <errno.h>
#include <sys/time.h> // select
#include <sys/types.h> // select
#include "assa/SigHandler.h"
#include "assa/SigHandlersList.h"
#include "assa/Handlers.h"
namespace ASSA {
#if !defined(WIN32)
class SigHandlers : public SigHandler
{
public:
static void sighandlers_dispatcher (int signum_);
virtual int install (int signum_,
EventHandler* new_hand_,
SigAction* new_disp_ = 0,
EventHandler** old_hand_ = 0,
SigAction* old_disp_ = 0);
virtual int remove (int signum_,
EventHandler* eh_,
SigAction* new_disp_ = 0,
SigAction* old_disp_ = 0);
private:
static void dispatch (int signum_);
};
#endif // !defined(WIN32)
} // end namespace ASSA
#endif /* _SigHandlers_h */
Handlers.h
A collection of various most popular signal handlers.
SigHandler.h
Class SigHandler is a UNIX signal handlers manager/dispatcher class.
SigHandlersList.h
SigHandlersList is a Singleton class that maps signal number to a set of EventHandlers listening for ...
ASSA::AutoPtrRef
A wrapper class to provide AutoPtr with reference semantics.
Definition AutoPtr.h:32
ASSA::EventHandler
EventHandler class.
Definition EventHandler.h:103
ASSA::SigAction
Definition SigAction.h:95
ASSA::SigHandler
Definition SigHandler.h:50
ASSA::SigHandlers
Definition SigHandlers.h:56
ASSA::SigHandlers::sighandlers_dispatcher
static void sighandlers_dispatcher(int signum_)
A wrapper around static SigHandlers::dispatch().
Definition SigHandlers.cpp:26
ASSA::SigHandlers::remove
virtual int remove(int signum_, EventHandler *eh_, SigAction *new_disp_=0, SigAction *old_disp_=0)
Remove EventHandler from the list of registered handler for signum_.
Definition SigHandlers.cpp:167
ASSA::SigHandlers::install
virtual int install(int signum_, EventHandler *new_hand_, SigAction *new_disp_=0, EventHandler **old_hand_=0, SigAction *old_disp_=0)
Register EventHandler with dispatching system.
Definition SigHandlers.cpp:36
ASSA::SigHandlers::dispatch
static void dispatch(int signum_)
The heart of SigHandlers class - this callback function is really registered with OS to catch all of ...
Definition SigHandlers.cpp:237
ASSA
Definition Acceptor.h:40