Honeycomb  0.1
Component-Model Framework
Namespaces | Macros | Variables
Debug.h File Reference
#include "Honey/Core/Core.h"
#include "Honey/Misc/platform/Debug.h"
Include dependency graph for Debug.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 honey
 Global Honeycomb namespace.
 
 honey::debug
 Debug Mode Functions
 

Macros

#define assert(...)    EVAL(TOKCAT(assert_, NUMARGS(__VA_ARGS__))(__VA_ARGS__))
 Forwards to assert_#args. See assert_1(), assert_2(). More...
 
#define verify(...)    EVAL(TOKCAT(verify_, NUMARGS(__VA_ARGS__))(__VA_ARGS__))
 Forwards to verify_#args. See verify_1(), verify_2(). More...
 
#define debug_if(...)    __VA_ARGS__
 Evaluate expression in debug mode only, does nothing in final mode. More...
 
#define debug_print(...)    { honey::debug::platform::print(__VA_ARGS__); }
 Print string to debug output window. Does nothing in final mode. More...
 
#define debug_break(msg)    { try { error_(msg); } catch (...) {} }
 Cause debugger to break. Debugger must have exception breakpoints enabled. More...
 
#define assert_1(expr)    assert_2(expr, "")
 Assert that an expression is true, otherwise throws AssertionFailure with the expression. Does nothing in final mode. More...
 
#define assert_2(expr, msg)    if (!(expr)) { honey::debug::platform::assertFail(#expr, __FUNC__, __FILE__, __LINE__, (msg)); }
 Assert with extra message to be displayed on failure. More...
 
#define verify_1(expr)    assert_1(expr)
 Similar to assert() but evaluates the expression and throws an error even in final mode. More...
 
#define verify_2(expr, msg)    assert_2(expr, msg)
 Verify with extra message to be displayed on failure. Message ignored in final mode. More...
 
#define error_(msg)    assert_2(false, msg)
 Throw AssertionFailure with a message. Message ignored in final mode. More...
 

Variables

static const bool honey::debug::enabled = true
 Flag to check if debug mode is enabled at compile-time/runtime. More...