OBT_ASSERT.h File Reference

#include "OBT_Exception.h"
#include "OBTTrace.h"
Include dependency graph for OBT_ASSERT.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define OBT_ASSERT(assertion)
 throws an exception if the tested assertion failed.
#define OBT_DBG_ASSERT(assertion)   OBT_ASSERT( assertion )
 throws an exception in debug mode if the tested assertion failed.
#define STATIC_CHECK(expr, msg)   typedef char ERROR_##msg[1][( expr )]

Define Documentation

#define OBT_ASSERT ( assertion   ) 
Value:
if ( !( assertion ) ) \
                                { \
                                std::string assertionMessage( "OBT Assertion Failed : " ) ; \
                                assertionMessage += #assertion ; \
                                TRACE_CRITICAL( assertionMessage.c_str() ) ; \
                                throw OBT::OBT_Exception( assertionMessage.c_str() ) ; \
                                }

throws an exception if the tested assertion failed.

Author:
Michaël Rouillé <michael.rouille@gmail.com>

Before throwing an exception, OBT_ASSERT traces a message labelled with the string representation of the expression which caused the assertion to fail.

Definition at line 15 of file OBT_ASSERT.h.

Referenced by OBT::OptionLastArg::argMatch(), OBT::OptionArg::atLastArg(), OBT::OptionArgHandler::get(), OBT::OptionArg::getArg(), OBT::OptionArg::getNextArg(), OBT::OptionArg::moveNextArg(), OBT::OptionArg::OptionArg(), OBT::OptionArg::peekArg(), and OBT::Plugin::Plugin().

#define OBT_DBG_ASSERT ( assertion   )     OBT_ASSERT( assertion )

throws an exception in debug mode if the tested assertion failed.

Author:
Micha�l Rouill� <michael.rouille@gmail.com>

Before throwing an exception, DBG_OBT_ASSERT traces a critical message labelled with the string representation of the expression which caused the assertion to fail.

Definition at line 33 of file OBT_ASSERT.h.

Referenced by OBT::addService(), OBT::AbstractAttribute::initRTTI(), OBT::PrimitiveAttribute< TOwner, TAttribute, typeID >::PrimitiveAttribute(), OBT::RTTI::RTTI(), OBT::TypedAttribute< TOwner, TAttribute >::setValue(), OBT::PrimitiveAttribute< TOwner, TAttribute, typeID >::setValue(), and OBT::TypedAttribute< TOwner, TAttribute >::TypedAttribute().

#define STATIC_CHECK ( expr,
msg   )     typedef char ERROR_##msg[1][( expr )]

Definition at line 39 of file OBT_ASSERT.h.


Generated on 1 Jan 2010 for OBT by  doxygen 1.6.1