vrpn 07.35
Virtual Reality Peripheral Network
 
Loading...
Searching...
No Matches
vrpn_Assert.h File Reference

Header for assert macros. More...

#include <assert.h>
Include dependency graph for vrpn_Assert.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define VRPN_CURRENT_FUNCTION   "(unknown)"
 Expands to the special preprocessor macro providing a useful description of the current function, where available.
 
#define VRPN_ASSERT(expr)
 Asserts the truth of expr according to the configuration of vrpn_Assert.h at the time of inclusion.
 
#define VRPN_ASSERT_MSG(expr, msg)
 Like VRPN_ASSERT(expr) but allows specification of a message to be included in the case of a failed assertion.
 
#define VRPN_VERIFY(expr)
 Typically forwards to VRPN_ASSERT, but in cases where VRPN_ASSERT would expand to nothing (not evaluating the expression), VRPN_VERIFY evaluates the expression but discards the result.
 
#define VRPN_VERIFY_MSG(expr, msg)
 Like VRPN_VERIFY(expr) but allows specification of a message to be included in the case of a failed assertion.
 

Detailed Description

Header for assert macros.

Include guards intentionally omitted, to allow re-inclusion with different options.

Assertions can either do nothing, call an assert handler on failure that prints details to stderr, or call your compiler system's assert.

  • Define VRPN_DISABLE_ASSERTS before including this file to forcibly disable all asserts.
  • By default, debug builds will use the standard assert method, and release builds will do nothing.
  • To unconditionally (debug and release) enable the custom assert handler, define VRPN_ENABLE_ASSERT_HANDLER
  • To enable the custom assert handler for debug builds only (leaving asserts as no-ops in release builds), define VRPN_ENABLE_ASSERT_DEBUG_HANDLER
Date
2015
Author
Ryan Pavlik (incorporating some code modified from Boost) Sensics, Inc. http://sensics.com/osvr

Definition in file vrpn_Assert.h.

Macro Definition Documentation

◆ VRPN_ASSERT

#define VRPN_ASSERT ( expr)
Value:
assert(expr)

Asserts the truth of expr according to the configuration of vrpn_Assert.h at the time of inclusion.

If not asserting, does not evaluate expression.

Definition at line 152 of file vrpn_Assert.h.

◆ VRPN_ASSERT_MSG

#define VRPN_ASSERT_MSG ( expr,
msg )
Value:
assert((expr) && (msg))

Like VRPN_ASSERT(expr) but allows specification of a message to be included in the case of a failed assertion.

Definition at line 153 of file vrpn_Assert.h.

Referenced by vrpn::EndpointIterator::EndpointIterator(), vrpn::OwningPtr< T, D >::operator*(), and vrpn::OwningPtr< T, D >::operator->().

◆ VRPN_CURRENT_FUNCTION

#define VRPN_CURRENT_FUNCTION   "(unknown)"

Expands to the special preprocessor macro providing a useful description of the current function, where available.

Definition at line 87 of file vrpn_Assert.h.

◆ VRPN_VERIFY

#define VRPN_VERIFY ( expr)
Value:
#define VRPN_ASSERT(expr)
Asserts the truth of expr according to the configuration of vrpn_Assert.h at the time of inclusion.

Typically forwards to VRPN_ASSERT, but in cases where VRPN_ASSERT would expand to nothing (not evaluating the expression), VRPN_VERIFY evaluates the expression but discards the result.

Definition at line 172 of file vrpn_Assert.h.

◆ VRPN_VERIFY_MSG

#define VRPN_VERIFY_MSG ( expr,
msg )
Value:
VRPN_ASSERT_MSG(expr,msg)
#define VRPN_ASSERT_MSG(expr, msg)
Like VRPN_ASSERT(expr) but allows specification of a message to be included in the case of a failed a...

Like VRPN_VERIFY(expr) but allows specification of a message to be included in the case of a failed assertion.

Definition at line 173 of file vrpn_Assert.h.