This is the main header file of libcwd. More...
Go to the source code of this file.
Classes | |
| struct | libcwd::Indent |
| Interface for marking scopes with indented debug output. More... | |
| struct | libcwd::Mark |
| Interface for marking scopes with a marker character. More... | |
| class | Channel |
| This object represents a debug channel, it has a fixed label. A debug channel can be viewed upon as a single bit: on or off. More... | |
Namespaces | |
| namespace | libcwd |
| namespace for libcwd. | |
Macros | |
| #define | Debug(...) |
| Encapsulation macro for general debugging code. | |
| #define | Dout(cntrl, ...) |
| Macro for writing debug output. | |
| #define | DoutEntering(cntrl, ...) |
| #define | DoutFatal(cntrl, ...) |
| Macro for writing fatal debug output to the default debug object libcw_do . | |
| #define | ForAllDebugChannels(...) |
| Looping over all debug channels. | |
| #define | ForAllDebugObjects(...) |
| Looping over all debug objects. | |
| #define | CW_DEBUG 1 |
| Define this macro as 1 when either CWDEBUG is defined or NDEBUG is not defined, otherwise as 0. | |
Don't include this header file directly. Instead use a custom debug.h header file that includes this file, that will allow others to compile your application without having libcwd installed.
| #define Debug | ( | ... | ) |
The parameter of this macro can be arbitrary code that will be eliminated from the application when the macro CWDEBUG is not defined.
It uses the namespaces LIBCWD_DEBUG_CHANNELS and libcwd, making it unnecessary to use the the full scopes for debug channels and utility functions provided by libcwd.
Examples:
| #define Dout | ( | cntrl, | |
| ... ) |
This macro is used for writing debug output to the default debug object libcw_do . No code is generated when the macro CWDEBUG is not defined, in that case the macro Dout is replaced by white space.
The macro Dout uses libcwds debug object libcw_do . You will have to define your own macro when you want to use a second debug object.
Examples:
| #define DoutEntering | ( | cntrl, | |
| ... ) |
Debugging macro.
Print "Entering " << data to channel cntrl and increment debugging output indentation until the end of the current scope.