宏定义 | |
#define | DEBUG_ASSERT(predicate) DEBUG_ONLY(assert(predicate)); |
#define | DEBUG_ASSERT_EQ(lhs, rhs) DEBUG_ASSERT((lhs) == (rhs)) |
#define | DEBUG_ASSERT_NE(lhs, rhs) DEBUG_ASSERT((lhs) != (rhs)) |
#define | DEBUG_ERROR DEBUG_ASSERT(false); |
#define | DEBUG_ONLY(code) code |
#define | DEVELOPMENT_ASSERT(pred) DEVELOPMENT_ONLY(LIBCARLA_ASSERT_THROW__(pred, #pred)) |
#define | DEVELOPMENT_ONLY(code) code |
#define | LIBCARLA_ASSERT_LEVEL LIBCARLA_ASSERT_LEVEL_DEBUG |
#define | LIBCARLA_ASSERT_LEVEL_DEBUG 30 |
用于断言和仅调试代码的宏实用程序。 更多... | |
#define | LIBCARLA_ASSERT_LEVEL_DEVELOPMENT 20 |
#define | LIBCARLA_ASSERT_LEVEL_RELEASE 10 |
#define | LIBCARLA_ASSERT_THROW__(pred, msg) if (!(pred)) { ::carla::throw_exception(std::runtime_error(msg)); } |
#define | RELEASE_ASSERT(pred) LIBCARLA_ASSERT_THROW__(pred, #pred) |
#define DEBUG_ASSERT | ( | predicate | ) | DEBUG_ONLY(assert(predicate)); |
#define DEBUG_ASSERT_EQ | ( | lhs, | |
rhs | |||
) | DEBUG_ASSERT((lhs) == (rhs)) |
#define DEBUG_ASSERT_NE | ( | lhs, | |
rhs | |||
) | DEBUG_ASSERT((lhs) != (rhs)) |
#define DEBUG_ERROR DEBUG_ASSERT(false); |
#define DEVELOPMENT_ASSERT | ( | pred | ) | DEVELOPMENT_ONLY(LIBCARLA_ASSERT_THROW__(pred, #pred)) |
#define LIBCARLA_ASSERT_LEVEL LIBCARLA_ASSERT_LEVEL_DEBUG |
#define LIBCARLA_ASSERT_LEVEL_DEBUG 30 |
用于断言和仅调试代码的宏实用程序。
定义三个级别的断言:debug、development 和 release 由default,如果定义了 NDEBUG,则级别设置为 development, 否则设置为 debug。
此处定义了以下宏:
#define LIBCARLA_ASSERT_THROW__ | ( | pred, | |
msg | |||
) | if (!(pred)) { ::carla::throw_exception(std::runtime_error(msg)); } |
#define RELEASE_ASSERT | ( | pred | ) | LIBCARLA_ASSERT_THROW__(pred, #pred) |