libassa  3.5.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SigHandler.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //------------------------------------------------------------------------------
3 // SigHandler.h
4 //------------------------------------------------------------------------------
5 // Copyright (c) 1997 by Vladislav Grinchenko
6 //
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Library General Public
9 // License as published by the Free Software Foundation; either
10 // version 2 of the License, or (at your option) any later version.
11 //------------------------------------------------------------------------------
12 #ifndef _SigHandler_h
13 #define _SigHandler_h
14 
15 // System includes
16 
17 #include <signal.h>
18 #include <errno.h>
19 
20 #include "assa/Logger.h"
21 #include "assa/IdSet.h"
22 #include "assa/SigSet.h"
23 #include "assa/SigAction.h"
24 #include "assa/EventHandler.h"
25 
26 namespace ASSA {
27 
28 #if !defined(WIN32)
29 
50 {
51 public:
54  virtual ~SigHandler () { /* no-op */ }
55 
71  virtual int install (int signum_,
72  EventHandler* new_hand_,
73  SigAction* new_disp_ = 0,
74  EventHandler** old_hand_ = 0,
75  SigAction* old_disp_ = 0);
76 
89  virtual int remove (int signum_,
90  EventHandler* eh_ = 0,
91  SigAction* new_disp_ = 0,
92  SigAction* old_disp_ = 0);
93 
103  static void dispatch (int signum_);
104 
111  EventHandler* handler (int signum_, EventHandler* new_);
112 
115  EventHandler* handler (int signum_);
116 
117 protected:
121  int in_range(int signum_);
122 
123 private:
128 };
129 
130 #endif // !defined(WIN32)
131 
132 } // end namespace ASSA
133 
134 #endif /* _SigHandler_h */