Several useful macros defined by the OGDF. More...
Assertions (only active in debug builds) | |
| #define | OGDF_ASSERT(expr) |
Assert condition expr. See doc/build.md for more information. More... | |
| #define | OGDF_HEAVY_ASSERT(expr) |
Assert condition expr when using heavy debugging. See OGDF_ASSERT. More... | |
Throwing exceptions | |
| #define | OGDF_THROW_PARAM(CLASS, PARAM) OGDF_FLUSH_OUTPUTS, throw CLASS(PARAM) |
Replacement for throw. More... | |
| #define | OGDF_THROW(CLASS) OGDF_FLUSH_OUTPUTS, throw CLASS() |
Replacement for throw. More... | |
Deprecation | |
| #define | OGDF_DEPRECATED(reason) |
| Mark a class / member / function as deprecated. More... | |
Optimization | |
| #define | OGDF_LIKELY(x) (x) |
| Specify the likely branch in a condition. More... | |
| #define | OGDF_UNLIKELY(x) (x) |
| Specify the unlikely branch in a condition. More... | |
| #define | OGDF_DECL_ALIGN(b) |
Specify the minimum alignment (in bytes) of a type to be b. This is used in type declarations. More... | |
Managing memory | |
| #define | OGDF_NEW_DELETE OGDF_MM(OGDF_ALLOCATOR) |
| Makes the class use OGDF's memory allocator. More... | |
| #define | OGDF_MALLOC_NEW_DELETE OGDF_MM(ogdf::MallocMemoryAllocator) |
| Makes the class use malloc for memory allocation. More... | |
Several useful macros defined by the OGDF.
| #define OGDF_ASSERT | ( | expr | ) |
Assert condition expr. See doc/build.md for more information.
| #define OGDF_DECL_ALIGN | ( | b | ) |
| #define OGDF_DEPRECATED | ( | reason | ) |
| #define OGDF_HEAVY_ASSERT | ( | expr | ) |
| #define OGDF_LIKELY | ( | x | ) | (x) |
Specify the likely branch in a condition.
Usage:
| #define OGDF_MALLOC_NEW_DELETE OGDF_MM(ogdf::MallocMemoryAllocator) |
Makes the class use malloc for memory allocation.
Creates new and delete operators in a class using the given memory allocator. In other words, adding this macro in a class declaration makes that class managed by the respective memory manager. Throws an ogdf::InsufficientMemoryException if no more memory is available.
| #define OGDF_NEW_DELETE OGDF_MM(OGDF_ALLOCATOR) |
Makes the class use OGDF's memory allocator.
Creates new and delete operators in a class using the given memory allocator. In other words, adding this macro in a class declaration makes that class managed by the respective memory manager. Throws an ogdf::InsufficientMemoryException if no more memory is available.
| #define OGDF_THROW | ( | CLASS | ) | OGDF_FLUSH_OUTPUTS, throw CLASS() |
Replacement for throw.
This macro is used to throw an exception and pass the file name and line number of the location in the source file (in Debug mode only).
| CLASS | is the name of the exception class. |
Definition at line 65 of file exceptions.h.
| #define OGDF_THROW_PARAM | ( | CLASS, | |
| PARAM | |||
| ) | OGDF_FLUSH_OUTPUTS, throw CLASS(PARAM) |
Replacement for throw.
This macro is used to throw an exception and pass the file name and line number of the location in the source file (in Debug mode only).
| CLASS | is the name of the exception class. |
| PARAM | is an additional parameter (like the error code) required by the exception calls. |
Definition at line 55 of file exceptions.h.
| #define OGDF_UNLIKELY | ( | x | ) | (x) |
Specify the unlikely branch in a condition.
Usage: