#include <stdexcept>
#include <sstream>
#include "opengm/config.hxx"
#include "opengm/utilities/metaprogramming.hxx"
Go to the source code of this file.
| #define OPENGM_ASSERT |
( |
|
expression | ) |
|
Value:if(!(expression)) { \
std::stringstream s; \
s << "OpenGM assertion " << #expression \
<< " failed in file " << __FILE__ \
<< ", line " << __LINE__ << std::endl; \
throw std::runtime_error(s.str()); \
}
Definition at line 77 of file opengm.hxx.
| #define OPENGM_ASSERT_OP |
( |
|
a, |
|
|
|
op, |
|
|
|
b |
|
) |
| |
Value:if(! static_cast<bool>( a op b ) ) { \
std::stringstream s; \
s << "OpenGM assertion : " << #a <<#op <<#b<< " failed:\n"; \
s << #a " = "<<a<<"\n"; \
s << #b " = "<<b<<"\n"; \
s << "in file " << __FILE__ << ", line " << __LINE__ << "\n"; \
throw std::runtime_error(s.str()); \
}
runtime assertion
Definition at line 53 of file opengm.hxx.
| #define OPENGM_CHECK |
( |
|
expression, |
|
|
|
message |
|
) |
| |
Value:if(!(expression)) { \
std::stringstream s; \
s << message <<"\n";\
s << "OpenGM assertion " << #expression \
<< " failed in file " << __FILE__ \
<< ", line " << __LINE__ << std::endl; \
throw std::runtime_error(s.str()); \
}
Definition at line 27 of file opengm.hxx.
| #define OPENGM_CHECK_OP |
( |
|
a, |
|
|
|
op, |
|
|
|
b, |
|
|
|
message |
|
) |
| |
Value:if(! static_cast<bool>( a op b ) ) { \
std::stringstream s; \
s << "OpenGM Error: "<< message <<"\n";\
s << "OpenGM check : " << #a <<#op <<#b<< " failed:\n"; \
s << #a " = "<<a<<"\n"; \
s << #b " = "<<b<<"\n"; \
s << "in file " << __FILE__ << ", line " << __LINE__ << "\n"; \
throw std::runtime_error(s.str()); \
}
Definition at line 16 of file opengm.hxx.
| #define OPENGM_META_ASSERT |
( |
|
assertion, |
|
|
|
msg |
|
) |
| |
Value:{ \
meta::Assert< meta::Compare< meta::Bool<(assertion)> , meta::Bool<true> >::value > \
OPENGM_COMPILE_TIME_ASSERTION_FAILED_____REASON_____##msg; \
(void) OPENGM_COMPILE_TIME_ASSERTION_FAILED_____REASON_____##msg; \
}
opengm compile time assertion
Definition at line 87 of file opengm.hxx.