#include <stdexcept>
#include <sstream>
#include <assert.h>
Go to the source code of this file.
|
#define | RASSERT(condition, message) EXCEPTION_ASSERT(std::runtime_error, condition, message) |
|
#define | LASSERT(condition, message) EXCEPTION_ASSERT(std::logic_error, condition, message) |
|
#define | RVASSERT(condition, message) VERBOSE_EXCEPTION_ASSERT(std::runtime_error, condition, message) |
|
#define | LVASSERT(condition, message) VERBOSE_EXCEPTION_ASSERT(std::logic_error, condition, message) |
|
#define | EXCEPTION_ASSERT(type, condition, message) |
|
#define | VERBOSE_EXCEPTION_ASSERT(type, condition, message) |
|
#define | ASSERT(condition, message) assert(condition) |
|
#define ASSERT |
( |
|
condition, |
|
|
|
message |
|
) |
| assert(condition) |
#define EXCEPTION_ASSERT |
( |
|
type, |
|
|
|
condition, |
|
|
|
message |
|
) |
| |
Value:
if((condition) ==
false){\
std::ostringstream buffer;\
buffer << "ERROR in file " << __FILE__ << " line " << __LINE__ << ": " << message;\
throw type(buffer.str());\
}\
}\
Throws an exception if condition is false
#define LASSERT |
( |
|
condition, |
|
|
|
message |
|
) |
| EXCEPTION_ASSERT(std::logic_error, condition, message) |
#define RASSERT |
( |
|
condition, |
|
|
|
message |
|
) |
| EXCEPTION_ASSERT(std::runtime_error, condition, message) |
#define VERBOSE_EXCEPTION_ASSERT |
( |
|
type, |
|
|
|
condition, |
|
|
|
message |
|
) |
| |
Value:
if((condition) ==
false){\
std::ostringstream buffer;\
buffer << "ERROR in file " << __FILE__ << " line " << __LINE__ << ": " << message;\
std::cerr << buffer.str() << endl;\
throw type(buffer.str());\
}\
}\
Throws an exception if condition is false