This group contains the exceptions defined in LEMON.
Classes | |
class | Exception |
Generic exception class. More... | |
class | IoError |
Input-Output error. More... | |
class | FormatError |
Format error. More... | |
Files | |
file | assert.h |
Extended assertion handling. | |
file | error.h |
Basic exception classes and error handling. | |
Macros | |
#define | LEMON_ASSERT(exp, msg) |
Macro for assertion with customizable message. | |
#define | LEMON_DEBUG(exp, msg) |
Macro for internal assertions. | |
#define LEMON_ASSERT | ( | exp, | |
msg | |||
) |
Macro for assertion with customizable message.
exp | An expression that must be convertible to bool . If it is false , then an assertion is raised. The concrete behaviour depends on the settings of the assertion system. |
msg | A const char* parameter, which can be used to provide information about the circumstances of the failed assertion. |
The assertions are enabled in the default behaviour. You can disable them with the following code:
or with compilation parameters:
The checking is also disabled when the standard macro NDEBUG
is defined.
As a default behaviour the failed assertion prints a short log message to the standard error and aborts the execution.
However, the following modes can be used in the assertion system:
LEMON_ASSERT_ABORT
The failed assertion prints a short log message to the standard error and aborts the program. It is the default behaviour.LEMON_ASSERT_CUSTOM
The user can define own assertion handler function. LEMON_CUSTOM_ASSERT_HANDLER
macro name. The assertion mode can also be changed within one compilation unit. If the macros are redefined with other settings and the assert.h file is reincluded, then the behaviour is changed appropiately to the new settings.
#define LEMON_DEBUG | ( | exp, | |
msg | |||
) |
Macro for internal assertions, it is used in the library to check the consistency of results of algorithms, several pre- and postconditions and invariants. The checking is disabled by default, but it can be turned on with the macro LEMON_ENABLE_DEBUG
.
or with compilation parameters:
This macro works like the LEMON_ASSERT
macro, therefore the current behaviour depends on the settings of LEMON_ASSERT
macro.