Classes | Namespaces | Defines | Functions

_src_base_assert.hh File Reference

Assertions. More...

Go to the source code of this file.

Classes

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

Namespaces

namespace  base
 

Library of base code.


namespace  base::RESTRICT
 

Internal.


Defines

#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_COUNT)   {{ ASSERT( (INSTANCE_COUNT) == 0 ); ++(INSTANCE_COUNT); }}
#define ASSERT_ONE_INSTANCE_DTOR(INSTANCE_COUNT)   {{ ASSERT( (INSTANCE_COUNT) == 1 ); --(INSTANCE_COUNT); }}
#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)
NO_INLINE void base::ASSERT_STACK_OBJECT (const void *obj)
NO_INLINE void base::ASSERT_PERSISTENT_OBJECT (const void *obj)

Detailed Description

Assertions.

LastChangedDate:
2011-04-23 21:07:07 -0400 (Sat, 23 Apr 2011)
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_COUNT  )     {{ ASSERT( (INSTANCE_COUNT) == 0 ); ++(INSTANCE_COUNT); }}
#define ASSERT_ONE_INSTANCE_DTOR (   INSTANCE_COUNT  )     {{ ASSERT( (INSTANCE_COUNT) == 1 ); --(INSTANCE_COUNT); }}
#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__ )
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Palomino Flight Simulator documents generated by doxygen 1.7.1 on Tue May 15 2012 22:40:10