Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
orxonox::SignalHandler Class Reference

The SignalHandler is used to catch signals like SIGSEGV and write a backtrace to the logfile. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/util/SignalHandler.h>

Inheritance diagram for orxonox::SignalHandler:
orxonox::Singleton< T >

Public Member Functions

void doCatch (const std::string &appName, const std::string &filename)
 register signal handlers for SIGSEGV and SIGABRT More...
 
void dontCatch ()
 restore previous signal handlers More...
 
void registerCallback (SignalCallback cb, void *someData)
 

Private Member Functions

void catchSignal (int sig)
 catch signal sig More...
 

Static Private Member Functions

static void sigHandler (int sig)
 sigHandler is called when receiving signals More...
 

Private Attributes

std::string appName
 
SignalCallbackList callbackList
 
std::string filename
 
SignalRecList sigRecList
 

Static Private Attributes

static SignalHandlersingletonPtr_s = nullptr
 

Friends

class Singleton< SignalHandler >
 

Additional Inherited Members

- Static Public Member Functions inherited from orxonox::Singleton< T >
static bool exists ()
 Tells whether the singleton has been created. More...
 
static T & getInstance ()
 Returns a reference to the singleton instance. More...
 
- Protected Member Functions inherited from orxonox::Singleton< T >
 Singleton ()
 Constructor sets the singleton instance pointer. More...
 
virtual ~Singleton ()
 Destructor resets the singleton instance pointer. More...
 

Detailed Description

The SignalHandler is used to catch signals like SIGSEGV and write a backtrace to the logfile.

Member Function Documentation

void orxonox::SignalHandler::catchSignal ( int  sig)
private

catch signal sig

Parameters
sigsignal to catch
void orxonox::SignalHandler::doCatch ( const std::string &  appName,
const std::string &  filename 
)

register signal handlers for SIGSEGV and SIGABRT

Parameters
appNamepath to executable eg argv[0]
filenamefilename to append backtrace to
void orxonox::SignalHandler::dontCatch ( )

restore previous signal handlers

void orxonox::SignalHandler::registerCallback ( SignalCallback  cb,
void someData 
)
void orxonox::SignalHandler::sigHandler ( int  sig)
staticprivate

sigHandler is called when receiving signals

Parameters
sig

Friends And Related Function Documentation

friend class Singleton< SignalHandler >
friend

Member Data Documentation

std::string orxonox::SignalHandler::appName
private
SignalCallbackList orxonox::SignalHandler::callbackList
private
std::string orxonox::SignalHandler::filename
private
SignalRecList orxonox::SignalHandler::sigRecList
private
SignalHandler * orxonox::SignalHandler::singletonPtr_s = nullptr
staticprivate

The documentation for this class was generated from the following files: