base_assert.hh File Reference

Assertions. More...

Go to the source code of this file.

Namespaces

namespace  base
namespace  base::restrict
namespace  std

Classes

class  base::AssertException
 Exception thrown when ASSERT*() evaluates false. More...

Defines

#define BASE_ASSERT_HH   1
#define ASSERT(COND)   base::restrict::Assert( (COND), __FILE__, __LINE__ )
#define ASSERT2(COND)
#define ASSERT_UNLESS_EXITING(COND)   base::restrict::AssertUnlessExiting( (COND), __FILE__, __LINE__ )
#define ASSERT_RUN_ONCE   {{ PERSISTENT int once = 0; ++once; ASSERT( once == 1 ); }}
#define ASSERT_ONE_INSTANCE_CTOR(INSTANCE_CNT)   {{ ASSERT( (INSTANCE_CNT) == 0 ); ++(INSTANCE_CNT); }}
#define ASSERT_ONE_INSTANCE_DTOR(INSTANCE_CNT)   {{ ASSERT( (INSTANCE_CNT) == 1 ); --(INSTANCE_CNT); }}
#define ASSERT_OR_RETURN(COND)   {{ ASSERT( (COND) ); if ( !(COND) ) return; }}
#define ASSERT_OR_RETURN_VAL(COND, VAL)   {{ ASSERT( (COND) ); if ( !(COND) ) return (VAL); }}
#define ASSERT_OR_GOTO(COND, LABEL)   {{ ASSERT( (COND) ); if ( !(COND) ) goto (LABEL); }}

Functions

void base::restrict::Assert (bool cond, const char *fileName, int fileLine)
void base::restrict::AssertUnlessExiting (bool cond, const char *fileName, int fileLine)
NOINLINE void base::ASSERT_STACK_OBJECT (const void *obj)
NOINLINE void base::ASSERT_PERSISTENT_OBJECT (const void *obj)
void base::ASSERT_MAIN_THREAD (void)


Detailed Description

Assertions.

Id
LastChangedDate

Author:
Jim E. Brooks http://www.palomino3d.org
Remarks:
An exception is thrown if an asertion fails. Since a failed assertion can be caught, assertions themselves can be tested. A missing exception results if an assertion that should fail aberrantly succeeds.

Define Documentation

#define ASSERT ( COND   )     base::restrict::Assert( (COND), __FILE__, __LINE__ )

#define ASSERT2 ( COND   ) 

#define ASSERT_ONE_INSTANCE_CTOR ( INSTANCE_CNT   )     {{ ASSERT( (INSTANCE_CNT) == 0 ); ++(INSTANCE_CNT); }}

#define ASSERT_ONE_INSTANCE_DTOR ( INSTANCE_CNT   )     {{ ASSERT( (INSTANCE_CNT) == 1 ); --(INSTANCE_CNT); }}

#define ASSERT_OR_GOTO ( COND,
LABEL   )     {{ ASSERT( (COND) ); if ( !(COND) ) goto (LABEL); }}

#define ASSERT_OR_RETURN ( COND   )     {{ ASSERT( (COND) ); if ( !(COND) ) return; }}

#define ASSERT_OR_RETURN_VAL ( COND,
VAL   )     {{ ASSERT( (COND) ); if ( !(COND) ) return (VAL); }}

#define ASSERT_RUN_ONCE   {{ PERSISTENT int once = 0; ++once; ASSERT( once == 1 ); }}

#define ASSERT_UNLESS_EXITING ( COND   )     base::restrict::AssertUnlessExiting( (COND), __FILE__, __LINE__ )

#define BASE_ASSERT_HH   1

Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:13 2007