libassa
3.5.0
|
00001 // -*- c++ -*- 00002 //------------------------------------------------------------------------------ 00003 // SigHandlers.h 00004 //------------------------------------------------------------------------------ 00005 // Copyright (C) 1997-2002 Vladislav Grinchenko 00006 // 00007 // This library is free software; you can redistribute it and/or 00008 // modify it under the terms of the GNU Library General Public 00009 // License as published by the Free Software Foundation; either 00010 // version 2 of the License, or (at your option) any later version. 00011 //------------------------------------------------------------------------------ 00012 00013 #ifndef _SigHandlers_h 00014 #define _SigHandlers_h 00015 00016 // System includes 00017 // 00018 #include <signal.h> 00019 #include <errno.h> 00020 #include <sys/time.h> // select 00021 #include <sys/types.h> // select 00022 00023 #include "assa/SigHandler.h" 00024 #include "assa/SigHandlersList.h" 00025 #include "assa/Handlers.h" 00026 00027 namespace ASSA { 00028 00029 #if !defined(WIN32) 00030 00055 class SigHandlers : public SigHandler 00056 { 00057 public: 00063 static void sighandlers_dispatcher (int signum_); 00064 00075 virtual int install (int signum_, 00076 EventHandler* new_hand_, 00077 SigAction* new_disp_ = 0, 00078 EventHandler** old_hand_ = 0, 00079 SigAction* old_disp_ = 0); 00080 00097 virtual int remove (int signum_, 00098 EventHandler* eh_, 00099 SigAction* new_disp_ = 0, 00100 SigAction* old_disp_ = 0); 00101 private: 00107 static void dispatch (int signum_); 00108 }; 00109 00110 #endif // !defined(WIN32) 00111 00112 } // end namespace ASSA 00113 00114 #endif /* _SigHandlers_h */