#include <string>
#include <cstdlib>
#include <btk/core/config/btk_config.hpp>
#include <btk/core/io/logging.hpp>
Go to the source code of this file.
Namespaces | |
namespace | BTK |
namespace | BTK::COMMON |
namespace | BTK::COMMON::ASSERTIONS |
Defines | |
#define | BTK_ASSERT(expr, str) |
#define | BTK_INVARIANT(expr) BTK_ASSERT(expr,"Invariant violated") |
Typedefs | |
typedef assert_code(*) | assert_handler (std::string const &, std::string const &, unsigned) |
Enumerations | |
enum | assert_code { EXIT, CONTINUE, IGNORE } |
Functions | |
std::string | make_assert_message (std::string const &msg, std::string const &file, unsigned line) |
assert_code | default_assert_handler (std::string const &msg, std::string const &file, unsigned line) |
Variables | |
assert_handler | current_assert_handler |
#define BTK_ASSERT | ( | expr, | |||
str | ) |
Value:
if (!(expr)) { \ using namespace BTK::COMMON::ASSERTIONS; \ static assert_code status = EXIT; \ \ if (status != IGNORE) { \ status = \ current_assert_handler((str), \ __FILE__, \ __LINE__); \ if (status == EXIT) std::exit(-1); \ } \ };
#define BTK_INVARIANT | ( | expr | ) | BTK_ASSERT(expr,"Invariant violated") |