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,
94 const
char* getMessage() const;
97 void setMessage(const
std::
string& message);
103 const
char* getFile() const;
537 (
const String& file,
int line,
585#ifdef BALL_COMPILER_MSVC
BALL_EXPORT std::ostream & operator<<(std::ostream &os, const Exception::GeneralException &e)
BALL_EXPORT GlobalExceptionHandler globalHandler
virtual ~GeneralException()
Destructor.
GeneralException()
Default constructor.
GeneralException(const char *file, int line, const String &name, const String &message)
Constructor.
GeneralException(const char *file, int line)
Constructor.
GeneralException(const GeneralException &exception)
Copy constructor.
IndexUnderflow(const char *file, int line, Index index=0, Size size=0)
SizeUnderflow(const char *file, int line, Size size=0)
IndexOverflow(const char *file, int line, Index index=0, Size size=0)
InvalidArgument(const char *file, int line, const String &arg)
InvalidRange(const char *file, int line, float value)
InvalidSize(const char *file, int line, Size size=0)
OutOfRange(const char *file, int line)
InvalidFormat(const char *file, int line, const String &s)
IllegalSelfOperation(const char *file, int line)
NullPointer(const char *file, int line)
InvalidIterator(const char *file, int line)
IncompatibleIterators(const char *file, int line)
NotImplemented(const char *file, int line)
IllegalTreeOperation(const char *file, int line)
OutOfMemory(const char *file, int line, Size size=0)
BufferOverflow(const char *file, int line)
DivisionByZero(const char *file, int line)
OutOfGrid(const char *file, int line)
FileNotFound(const char *file, int line, const String &filename)
IllegalPosition(const char *file, int line, float x, float y, float z)
ParseError(const char *file, int line, const String &expression, const String &message)
Precondition(const char *file, int line, const char *condition)
Postcondition(const char *file, int line, const char *condition)
Exception to be thrown if an invalid option is given.
InvalidOption(const char *file, int line, String option)
Exception to be thrown if too many errors occur, e.g. in ForceField.
TooManyErrors(const char *file, int line)
Exception to be thrown if too many bonds for one atom.
TooManyBonds(const char *file, int line, const String &error)
CUDAError(const char *file, int line, const String &error)
NoBufferAvailable(const char *file, int line, const String &reason)
FormatUnsupported(const char *file, int line)
NotInitialized(const char *file, int line, const String &reason)
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_