Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Static Public Member Functions | Static Protected Member Functions | Private Member Functions

GlobalExceptionHandler Class Reference
[Exceptions]

OpenMS global exception handler. More...

#include <OpenMS/CONCEPT/GlobalExceptionHandler.h>

List of all members.

Static Public Member Functions

static GlobalExceptionHandlergetInstance ()
 The accessor for the singleton. It also serves as a replacement for the constructor.
Accessors

static void setName (const std::string &name) throw ()
static void setMessage (const std::string &message) throw ()
static void setLine (int line) throw ()
static void setFile (const std::string &file) throw ()
static void setFunction (const std::string &function) throw ()
static void set (const std::string &file, int line, const std::string &function, const std::string &name, const std::string &message) throw ()

Static Protected Member Functions

static void terminate () throw ()
 The OPENMS replacement for terminate.
static void newHandler () throw (OutOfMemory)
 The OPENMS new handler.
Wrapper for static member.

Note:
To avoid problems when accessing uninitialised static members we replaced them with static functions returning references to the members.
static std::string & file_ ()
 wrapper for static member file_
static int & line_ ()
 wrapper for static member line_
static std::string & function_ ()
 wrapper for static member function_
static std::string & name_ ()
 wrapper for static member name_
static std::string & what_ ()
 wrapper for static member what_

Private Member Functions

 GlobalExceptionHandler (const GlobalExceptionHandler &)
 private version of c'tor to avoid initialization
 ~GlobalExceptionHandler ()
Constructors

 GlobalExceptionHandler () throw ()
 Default constructor.

Detailed Description

OpenMS global exception handler.


Constructor & Destructor Documentation

GlobalExceptionHandler (  )  throw () [private]

Default constructor.

This constructor installs the OPENMS specific handlers for terminate, unexpected, and new_handler. terminate or unexpected are called to abort a program if an exception was not caught or a function exits via an exception that is not allowed by its exception specification. Both functions are replaced by a function of GlobalExceptionHandler that tries to determine the last exception thrown. This mechanism only works, if all exceptions are derived from Base.

The default new_handler is replaced by newHandler and throws an exception of type OutOfMemory instead of bad_alloc (the default behaviour defined in the ANSI C++ standard).

GlobalExceptionHandler ( const GlobalExceptionHandler  )  [inline, private]

private version of c'tor to avoid initialization

~GlobalExceptionHandler (  )  [inline, private]

Member Function Documentation

static std::string& file_ (  )  [inline, static, protected]

wrapper for static member file_

static std::string& function_ (  )  [inline, static, protected]

wrapper for static member function_

static GlobalExceptionHandler& getInstance (  )  [inline, static]
static int& line_ (  )  [inline, static, protected]

wrapper for static member line_

static std::string& name_ (  )  [inline, static, protected]

wrapper for static member name_

static void newHandler (  )  throw (OutOfMemory) [static, protected]

The OPENMS new handler.

static void set ( const std::string &  file,
int  line,
const std::string &  function,
const std::string &  name,
const std::string &  message 
) throw () [static]
static void setFile ( const std::string &  file  )  throw () [static]
static void setFunction ( const std::string &  function  )  throw () [static]
static void setLine ( int  line  )  throw () [static]
static void setMessage ( const std::string &  message  )  throw () [static]
static void setName ( const std::string &  name  )  throw () [static]
static void terminate (  )  throw () [static, protected]

The OPENMS replacement for terminate.

static std::string& what_ (  )  [inline, static, protected]

wrapper for static member what_


OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:59 using doxygen 1.7.1