30 #if defined(Assert_RECURSES)
31 #error Recursive header files inclusion detected in Assert.h
34 #define Assert_RECURSES
43 #include "DGtal/base/Trace.h"
44 #include <boost/current_function.hpp>
61 #define ASSERT(expr) ((void)0)
65 assert_failed(
const std::string& expr,
const std::string&
function,
const std::string& file,
long int line)
68 <<
" Assertion Error - assertion (" << expr <<
") failed in " <<
function <<
": "
69 << file <<
'(' << line <<
")" << std::endl;
72 #define ASSERT(expr) ((expr) ? ((void)0) : ::DGtal::assert_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
77 #define ASSERT_MSG(expr, msg) ((void)0)
81 assert_failed_message(
const std::string& expr,
const std::string& message,
const std::string&
function,
const std::string& file,
long int line)
84 <<
" Assertion Error - assertion (" << expr <<
") failed in " <<
function <<
": "
85 << file <<
'(' << line <<
"): " << std::endl << message << std::endl;
88 #define ASSERT_MSG(expr,msg) ((expr) ? ((void)0) : ::DGtal::assert_failed_message(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
93 fatal_error_failed(
const std::string& expr,
const std::string&
function,
const std::string& file,
long int line)
96 <<
" Fatal Error - assertion (" << expr <<
") failed in " <<
function <<
": "
97 << file <<
'(' << line <<
")" << std::endl;
100 #define FATAL_ERROR(expr) ((expr) ? ((void)0) : ::DGtal::fatal_error_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
104 fatal_error_failed_message(
const std::string& expr,
const std::string& message,
const std::string&
function,
const std::string& file,
long int line)
107 <<
" Fatal Error - assertion (" << expr <<
") failed in " <<
function <<
": "
108 << file <<
'(' << line <<
"): " << std::endl << message << std::endl;
111 #define FATAL_ERROR_MSG(expr,msg) ((expr) ? ((void)0) : ::DGtal::fatal_error_failed_message(#expr,msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
117 #undef Assert_RECURSES
DGtal is the top-level namespace which contains all DGtal functions and types.
void fatal_error_failed_message(const std::string &expr, const std::string &message, const std::string &function, const std::string &file, long int line)
void fatal_error_failed(const std::string &expr, const std::string &function, const std::string &file, long int line)
void assert_failed(const std::string &expr, const std::string &function, const std::string &file, long int line)
void assert_failed_message(const std::string &expr, const std::string &message, const std::string &function, const std::string &file, long int line)