Loading...
Searching...
No Matches
BALL::Exception::GlobalExceptionHandler Class Reference

`#include <BALL/COMMON/exception.h>`

## Public Member Functions

Constructors
| GlobalExceptionHandler ()

## Accessors

static std::string | file_
static int | line_
static std::string | name_
static std::string | message_
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 void | terminate ()
| The BALL replacement for terminate.
static void | newHandler ()

## Detailed Description

Class handling uncaught exception globally.

Definition at line 493 of file COMMON/exception.h.

## Constructor & Destructor Documentation

## GlobalExceptionHandler()

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

## Member Function Documentation

## newHandler()

void BALL::Exception::GlobalExceptionHandler::newHandler | ( |  | ) |

static protected

The BALL new handler

Exceptions

  BALL::Exception::OutOfMemory |

## set()

void BALL::Exception::GlobalExceptionHandler::set | ( | const String & | file,
|  | int | line,
|  | const String & | name,
|  | const String & | message )

static

Set all exception attributes.

## setFile()

void BALL::Exception::GlobalExceptionHandler::setFile | ( | const String & | file | ) |

static

The source file name where the exception was thrown.

## setLine()

void BALL::Exception::GlobalExceptionHandler::setLine | ( | int | line | ) |

static

Set the line number the exception was thrown. Should be set to LINE in most cases.

## setMessage()

void BALL::Exception::GlobalExceptionHandler::setMessage | ( | const String & | message | ) |

static

Set the error message.

## setName()

void BALL::Exception::GlobalExceptionHandler::setName | ( | const String & | name | ) |

static

Assign the name of the exception. This should agree with the class name.

## terminate()

void BALL::Exception::GlobalExceptionHandler::terminate | ( |  | ) |

static protected

The BALL replacement for terminate.

## Member Data Documentation

## file_

std::string BALL::Exception::GlobalExceptionHandler::file_

static protected

Definition at line 551 of file COMMON/exception.h.

## line_

int BALL::Exception::GlobalExceptionHandler::line_

static protected

Definition at line 552 of file COMMON/exception.h.

## message_

std::string BALL::Exception::GlobalExceptionHandler::message_

static protected

Definition at line 554 of file COMMON/exception.h.

## name_

std::string BALL::Exception::GlobalExceptionHandler::name_

static protected

Definition at line 553 of file COMMON/exception.h.