BALL::Exception::GlobalExceptionHandler Class Reference

Class handling uncaught exception globally. More...

#include <exception.h>

List of all members.


Public Member Functions

Constructors
GlobalExceptionHandler ()
Default constructor.

Static Public Member Functions

Accessors
static void setName (const String &name)
Assign the name of the exception. This should agree with the class name.
static void setMessage (const String &message)
Set the error message.
static void setLine (int line)
Set the line number the exception was thrown. Should be set to __LINE__ in most cases.
static void setFile (const String &file)
The source file name where the exception was thrown.
static void set (const String &file, int line, const String &name, const String &message)
Set all exception attributes.

Static Protected Member Functions

static void terminate ()
The BALL replacement for terminate.
static void newHandler () throw (Exception::OutOfMemory)
The BALL new handler.

Static Protected Attributes

static std::string file_
static int line_
static std::string name_
static std::string message_

Detailed Description

Class handling uncaught exception globally.

Constructor & Destructor Documentation

BALL::Exception::GlobalExceptionHandler::GlobalExceptionHandler ( )

Default constructor.

This constructor installs the BALL 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 defrived from GeneralException .

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).

Generated on Thu Aug 6 18:30:51 2009 for BALL by doxygen 1.5.8