#include "common/common.h"
#include <sstream>
Go to the source code of this file.
Classes |
class | wave_exception |
class | wave_ex |
| Smart exception object. More...
|
Defines |
|
|
#define | WAVE_EX(name) wave_ex name ( __FILE__ , __LINE__ ) |
| handy macro to define an exception object, including file and line
|
#define | ASSERT_THROW(exp, msg) |
| handy macro to quickly throw with a simple message if the given expression is false
|
#define | THROW(exp, msg) ASSERT_THROW(exp, msg) |
| DEPRECATED.
|
#define | ASSERT2(exp, msg) |
| similar macro, but halts (this is handy if you need to flip back and forth between throwing and halting versions).
|
Define Documentation
#define WAVE_EX |
( |
|
name |
) |
wave_ex name ( __FILE__ , __LINE__ ) |
handy macro to define an exception object, including file and line
Definition at line 116 of file wave_ex.h.
#define ASSERT_THROW |
( |
|
exp, |
|
|
|
msg | |
|
) |
| | |
Value:{ \
if (!(exp)) { \
WAVE_EX(wex); \
wex << "Assertion failed: " << #exp ; \
wex << "\n" << msg; \
} \
}
handy macro to quickly throw with a simple message if the given expression is false
Definition at line 121 of file wave_ex.h.
#define THROW |
( |
|
exp, |
|
|
|
msg | |
|
) |
| | ASSERT_THROW(exp, msg) |
#define ASSERT2 |
( |
|
exp, |
|
|
|
msg | |
|
) |
| | |
Value:{ \
if (!(exp)) { \
std::ostringstream oss; \
oss << msg; \
ASSERT( exp , "%s", oss.str().c_str()); \
} \
}
similar macro, but halts (this is handy if you need to flip back and forth between throwing and halting versions).
Eventually the standard ASSERT() macro should be replaced with this one.
Definition at line 136 of file wave_ex.h.