CMS 3D CMS Logo

IgOnCrashService.h

Go to the documentation of this file.
00001 #ifndef IGUANA_FRAMEWORK_IG_ON_CRASH_SERVICE_H
00002 # define IGUANA_FRAMEWORK_IG_ON_CRASH_SERVICE_H
00003 
00004 //<<<<<< INCLUDES                                                       >>>>>>
00005 
00006 # include "Iguana/Framework/interface/config.h"
00007 # include "classlib/utils/Signal.h"
00008 # include <string>
00009 
00010 //<<<<<< PUBLIC DEFINES                                                 >>>>>>
00011 //<<<<<< PUBLIC CONSTANTS                                               >>>>>>
00012 //<<<<<< PUBLIC TYPES                                                   >>>>>>
00013 //<<<<<< PUBLIC VARIABLES                                               >>>>>>
00014 //<<<<<< PUBLIC FUNCTIONS                                               >>>>>>
00015 //<<<<<< CLASS DECLARATIONS                                             >>>>>>
00016 
00017 class IGUANA_FRAMEWORK_API IgOnCrashService
00018 {
00019 public:
00020     // FIXME: must be able to unwind for GUI -- can't be simple hook!
00021     //        Use signal facilities directly?
00022     typedef bool (*FatalSignalHook) (int sig, siginfo_t *info, void *x);
00023     typedef void (*FatalExceptionHook) (const char *type, const char *what);
00024 
00025     static bool                 init (const char *appname);
00026     static FatalSignalHook      fatalSignalHook (FatalSignalHook hook);
00027     static FatalExceptionHook   fatalExceptionHook (FatalExceptionHook hook);
00028 
00029     static const char *         fatalTitle (void);
00030     static const char *         fatalMessage (void);
00031     static void                 printFatalMessage (const char *topic,
00032                                                    const char *title,
00033                                                    const char *reason);
00034     static void                 printFatalException (const char *type,
00035                                                      const char *what);
00036     static void                 fatalException (const char *type,
00037                                                 const char *what);
00038 
00039 private:
00040     IgOnCrashService (/* FIXME */);
00041     // implicit copy constructor
00042     // implicit assignment operator
00043     // implicit destructor
00044 
00045     static bool                 fatalSignal (int sig, siginfo_t *info, void *x);
00046     static bool                 defaultFatalSignal (int sig, siginfo_t *info, void *x);
00047     static void                 defaultFatalException (const char *type,
00048                                                        const char *what);
00049 
00050     static void                 explainException (const char *type,
00051                                                   const char *what,
00052                                                   std::string &topic,
00053                                                   std::string &title,
00054                                                   std::string &reason);
00055 
00056     static FatalSignalHook      s_signalHook;
00057     static FatalExceptionHook   s_exceptionHook;
00058 };
00059 
00060 //<<<<<< INLINE PUBLIC FUNCTIONS                                        >>>>>>
00061 //<<<<<< INLINE MEMBER FUNCTIONS                                        >>>>>>
00062 
00063 #endif // IGUANA_FRAMEWORK_IG_ON_CRASH_SERVICE_H
00064 
00065 

Generated on Tue Jun 9 17:38:23 2009 for CMSSW by  doxygen 1.5.4