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 00053 class SigHandlers : public SigHandler 00054 { 00055 public: 00061 static void sighandlers_dispatcher (int signum_); 00062 00073 virtual int install (int signum_, 00074 EventHandler* new_hand_, 00075 SigAction* new_disp_ = 0, 00076 EventHandler** old_hand_ = 0, 00077 SigAction* old_disp_ = 0); 00078 00095 virtual int remove (int signum_, 00096 EventHandler* eh_, 00097 SigAction* new_disp_ = 0, 00098 SigAction* old_disp_ = 0); 00099 private: 00105 static void dispatch (int signum_); 00106 }; 00107 00108 } // end namespace ASSA 00109 00110 #endif /* _SigHandlers_h */