Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

SignalController.h

Go to the documentation of this file.
00001 00030 #ifndef SIGNALCONTROLLER_H 00031 #define SIGNALCONTROLLER_H 00032 00033 #include <signal.h> 00034 #include <map> 00035 #include "BPExceptions.h" 00036 #include "SignalStrategy.h" 00037 #include "SysHook.h" 00038 00057 class SignalController 00058 { 00059 public: 00064 SignalController(SysHook& mgt_hook); 00065 00070 ~SignalController(); 00071 00085 SignalStrategy* addSignalStrategy(int signo, SignalStrategy* strat); 00086 00096 SignalStrategy* removeSignalStrategy(int signo); 00097 00104 static SignalController& instance() 00105 throw(BoilerPlate::IllegalStateException); 00106 00107 private: 00108 static SignalController* _instance; 00109 SysHook& _mgt_hook; 00110 typedef std::map<int, SignalStrategy*> StrategyMap; 00111 StrategyMap _strats; 00112 00113 static void dispatch_signal(int signo, siginfo_t* info, void* context); 00114 void _process_signal(int signo, siginfo_t* info, void* context); 00115 }; 00116 00117 #endif