Proton
1.1.1
Make porting easy from Python to C++11
|
Macros, global variables, classes for debug. More...
Classes | |
class | proton::err |
The exception class. More... |
Macros | |
#define | PROTON_DEBUG_OPT 1 |
Control debug macros. | |
#define | PROTON_LOG(lvl, out) |
Log messages to cerr. | |
#define | PROTON_THROW_IF(cond, out) |
Proton's inverse assert. | |
#define | PROTON_ERR(out) |
Throw an err. |
Variables | |
int | proton::debug_level |
The level controls output of PROTON_LOG(). | |
bool | proton::log_console |
true: PROTON_LOG/PROTON_THROW_IF/PROTON_ERR will output to console, false: no console output for these macros. | |
int | proton::wait_on_err |
0: nonstop, 1: stop on PROTON_ERR, 2: stop on PROTON_THROW_IF assert |
Macros, global variables, classes for debug.
#define PROTON_DEBUG_OPT 1 |
#define PROTON_ERR | ( | out | ) |
Throw an err.
Throw a proton::err("err"), and output a message. If proton::wait_on_err >= 1, it will hold the program and wait for any key. You can use gdb to attach the process to check what's happened.
out | the message describing what's happened. |
#define PROTON_LOG | ( | lvl, | |
out | |||
) |
Log messages to cerr.
Output messages when lvl <= proton::debug_level.
lvl | the log level. |
out | messages to be outputed, they can be concatenated using "<<". |
#define PROTON_THROW_IF | ( | cond, | |
out | |||
) |
Proton's inverse assert.
Throw if cond is true, and output the reason. If proton::wait_on_err >= 2, it will hold the program and wait for any key. You can use gdb to attach the process to check what's happened.
cond | the condition to check, throw proton::err("assert") if it's true. |
out | the message describing what's happened. |
Definition at line 90 of file base.hpp.
Referenced by proton::ref_< objT, allocator >::operator()(), proton::operator>>(), proton::ref_< objT, allocator >::operator[](), proton::set_< T, C, A >::pop(), proton::map_< K, T, C, A >::pop(), and proton::map_< K, T, C, A >::popitem().