libH/SignalHandler.hpp

Go to the documentation of this file.
00001 
00012 /*
00013   
00014   Copyright (c) 2007, Tim Burrell
00015   Licensed under the Apache License, Version 2.0 (the "License");
00016   you may not use this file except in compliance with the License.
00017   You may obtain a copy of the License at 
00018 
00019         http://www.apache.org/licenses/LICENSE-2.0
00020 
00021   Unless required by applicable law or agreed to in writing, software
00022   distributed under the License is distributed on an "AS IS" BASIS,
00023   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00024   See the License for the specific language governing permissions and 
00025   limitations under the License. 
00026   
00027 */
00028 
00029 #ifndef __SignalHandler_h
00030 #define __SignalHandler_h
00031 
00032 #if HAVE_CONFIG_H
00033 #include "config.h"
00034 #endif
00035 
00036 #include "Debug.hpp"
00037 #include <cstdlib>
00038 #include <iostream>
00039 #include <boost/any.hpp>
00040 #include <boost/function.hpp>
00041 
00043 // Namespace
00045 
00046 namespace H {
00047 
00049 // Typedef's / Defines
00051                 
00053 // Class Definition
00055 
00062 class SignalHandler {
00063 public:
00064         // Public Member Functions
00065         void                    initSignals();                  
00066         virtual void            onSignalSegv();                 
00067         virtual void            onSignalInt();                  
00068         virtual void            onSignalHup();                  
00069         virtual void            onSignalQuit();                 
00070         virtual void            onSignalKill();                 
00071         virtual void            onSignalTerm();                 
00072         virtual void            onSignalStop();                 
00073         virtual void            onSignalUnknown(int Signal);    
00074         
00075         // Construction / Deconstruction
00076         SignalHandler();
00077         virtual ~SignalHandler();
00078 
00079         // public member variables
00080         static SignalHandler *  mpThis;                         
00081 
00082 private:
00083         // Private Member Functions
00084         static void             signalHandler(int Signal);      
00085 
00086         // Private Member Variables
00087 };
00088 
00089 } // H namespace
00090 
00091 #endif // __SignalHandler_h

Generated on Wed Nov 7 10:04:16 2007 for gizmod by  doxygen 1.5.3