5#ifndef BALL_COMMON_EXCEPTION_H
6#define BALL_COMMON_EXCEPTION_H
8#ifndef BALL_CONFIG_CONFIG_H
9# include <BALL/CONFIG/config.h>
12#ifndef BALL_COMMON_GLOBAL_H
16#ifdef BALL_COMPILER_MSVC
18 #pragma warning( disable : 4251 )
60 :
public std::exception
76 (
const char* file,
int line,
537 (
const String& file,
int line,
585#ifdef BALL_COMPILER_MSVC
BufferOverflow(const char *file, int line)
CUDAError(const char *file, int line, const String &error)
DivisionByZero(const char *file, int line)
String getFilename() const
FileNotFound(const char *file, int line, const String &filename)
const char * getFile() const
Returns the file where it occurred.
void setMessage(const std::string &message)
Modify the exception's error message.
int getLine() const
Returns the line number where it occurred.
virtual ~GeneralException()
Destructor.
const char * getMessage() const
Returns the error message of the exception.
GeneralException()
Default constructor.
GeneralException(const char *file, int line, const String &name, const String &message)
Constructor.
const char * getName() const
Returns the name of the exception.
GeneralException(const char *file, int line)
Constructor.
GeneralException(const GeneralException &exception)
Copy constructor.
static void set(const String &file, int line, const String &name, const String &message)
Set all exception attributes.
static void setFile(const String &file)
The source file name where the exception was thrown.
static void setName(const String &name)
Assign the name of the exception. This should agree with the class name.
static void setLine(int line)
Set the line number the exception was thrown. Should be set to LINE in most cases.
static void terminate()
The BALL replacement for terminate.
static void setMessage(const String &message)
Set the error message.
static std::string message_
IllegalPosition(const char *file, int line, float x, float y, float z)
IllegalSelfOperation(const char *file, int line)
IllegalTreeOperation(const char *file, int line)
IncompatibleIterators(const char *file, int line)
IndexOverflow(const char *file, int line, Index index=0, Size size=0)
IndexUnderflow(const char *file, int line, Index index=0, Size size=0)
InvalidArgument(const char *file, int line, const String &arg)
InvalidIterator(const char *file, int line)
InvalidOption(const char *file, int line, String option)
InvalidRange(const char *file, int line, float value)
InvalidSize(const char *file, int line, Size size=0)
NoBufferAvailable(const char *file, int line, const String &reason)
NotImplemented(const char *file, int line)
NotInitialized(const char *file, int line, const String &reason)
NullPointer(const char *file, int line)
OutOfGrid(const char *file, int line)
OutOfMemory(const char *file, int line, Size size=0)
OutOfRange(const char *file, int line)
ParseError(const char *file, int line, const String &expression, const String &message)
Postcondition(const char *file, int line, const char *condition)
Precondition(const char *file, int line, const char *condition)
SizeUnderflow(const char *file, int line, Size size=0)
TooManyBonds(const char *file, int line, const String &error)
TooManyErrors(const char *file, int line)
BALL_EXPORT GlobalExceptionHandler globalHandler