36#include <ogdf/basic/internal/config_autogen.h>
47#define OGDF_FLUSH_OUTPUTS std::cout << std::flush, ::ogdf::Logger::sfout() << std::flush
58#define OGDF_THROW_PARAM(CLASS, PARAM) OGDF_FLUSH_OUTPUTS, throw CLASS(PARAM)
67#define OGDF_THROW(CLASS) OGDF_FLUSH_OUTPUTS, throw CLASS()
70# undef OGDF_THROW_PARAM
71# define OGDF_THROW_PARAM(CLASS, PARAM) \
72 OGDF_FLUSH_OUTPUTS, throw CLASS(PARAM, __FILE__, __LINE__)
74# define OGDF_THROW(CLASS) OGDF_FLUSH_OUTPUTS, throw CLASS(__FILE__, __LINE__)
177 explicit Exception(
const char* file =
nullptr,
int line = -1) : m_file(file), m_line(line) { }
183 const char*
file()
const {
return m_file; }
189 int line()
const {
return m_line; }
191 const char*
what() const noexcept
override {
return "Unknown OGDF Exception"; }
252 :
Exception(file, line), m_exceptionCode(code) { }
261 const char*
what() const noexcept
override {
return codeToString(m_exceptionCode); }
278 :
Exception(file, line), m_exceptionCode(code) { }
Contains logging functionality.
Basic declarations, included by all source files.
Exception thrown when an algorithm realizes an internal bug that prevents it from continuing.
AlgorithmFailureCode m_exceptionCode
The error code specifying the exception.
AlgorithmFailureCode exceptionCode() const
Returns the error code of the exception.
static const char * codeToString(AlgorithmFailureCode code)
AlgorithmFailureException(const char *file=nullptr, int line=-1)
Constructs an algorithm failure exception.
const char * what() const noexcept override
AlgorithmFailureException(AlgorithmFailureCode code, const char *file=nullptr, int line=-1)
Constructs an algorithm failure exception.
The parameterized class Array implements dynamic arrays of type E.
Exception thrown when result of cast is 0.
DynamicCastFailedException(const char *file=nullptr, int line=-1)
Constructs a dynamic cast failed exception.
Base class of all ogdf exceptions.
const char * m_file
Source file where exception occurred.
int m_line
Line number where exception occurred.
Exception(const char *file=nullptr, int line=-1)
Constructs an exception.
const char * what() const noexcept override
int line() const
Returns the line number where the exception was thrown.
const char * file() const
Returns the name of the source file where exception was thrown.
Exception thrown when not enough memory is available to execute an algorithm.
InsufficientMemoryException(const char *file=nullptr, int line=-1)
Constructs an insufficient memory exception.
Exception thrown when an external library shall be used which is not supported.
LibraryNotSupportedCode exceptionCode() const
Returns the error code of the exception.
LibraryNotSupportedCode m_exceptionCode
The error code specifying the exception.
LibraryNotSupportedException(const char *file=nullptr, int line=-1)
Constructs a library not supported exception.
LibraryNotSupportedException(LibraryNotSupportedCode code, const char *file=nullptr, int line=-1)
Constructs a library not supported exception.
Exception thrown when a required standard comparer has not been specialized.
NoStdComparerException(const char *file=nullptr, int line=-1)
Constructs a no standard comparer available exception.
Exception thrown when a data type is not supported by a generic function.
TypeNotSupportedException(const char *file=nullptr, int line=-1)
Constructs a type-not-supported exception.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
AlgorithmFailureCode
Code for an internal failure condition.
LibraryNotSupportedCode
Code for the library which was intended to get used, but its use is not supported.
@ IndexOutOfBounds
index out of bounds
@ ExternalFace
external face not correct
@ ForbiddenCrossing
crossing forbidden but necessary
@ NoFlow
min-cost flow could not find a legal flow
@ Sort
sequence not sorted
@ NoSolutionFound
couldn't solve the problem
@ IllegalParameter
function parameter is illegal
@ TimelimitExceeded
it took too long
@ MissingCallbackImplementation
@ FunctionNotImplemented
the used library doesn't support that function
@ Abacus
ABACUS not supported.
@ Cgal
CGAL not supported.
@ Coin
COIN not supported.
The namespace for all OGDF objects.