Invariant.h File Reference

#include <assert.h>
#include <string>
#include <iostream>
#include <stdexcept>
#include <RDGeneral/RDLog.h>

Go to the source code of this file.

Namespaces

namespace  Invar

Classes

class  Invar::Invariant

Defines

#define INVARIANT_EXCEPTION_METHOD   1
#define ASSERT_INVARIANT(expr, mess)   assert( expr )
#define CHECK_INVARIANT(expr, mess)
#define PRECONDITION(expr, mess)
#define POSTCONDITION(expr, mess)
#define UNDER_CONSTRUCTION(fn)
#define RANGE_CHECK(lo, x, hi)
#define TEST_ASSERT(expr)

Functions

std::ostream & Invar::operator<< (std::ostream &s, Invariant &inv)


Define Documentation

#define ASSERT_INVARIANT ( expr,
mess   )     assert( expr )

Definition at line 102 of file Invariant.h.

#define CHECK_INVARIANT ( expr,
mess   ) 

#define INVARIANT_EXCEPTION_METHOD   1

Definition at line 22 of file Invariant.h.

#define POSTCONDITION ( expr,
mess   ) 

Value:

if ( !(expr) ) { \
     Invar::Invariant inv( "Post-condition Violation", mess, \
     #expr, __FILE__, __LINE__ );\
     BOOST_LOG(rdErrorLog) << "\n\n****\n" << inv << "****\n\n"; throw inv; }

Definition at line 121 of file Invariant.h.

Referenced by RDGeom::Point3D::getPerpendicular(), and PySequenceHolder< T >::operator[]().

#define PRECONDITION ( expr,
mess   ) 

#define RANGE_CHECK ( lo,
x,
hi   ) 

#define TEST_ASSERT ( expr   ) 

Value:

if ( !(expr) ) {\
     Invar::Invariant inv( "Test Assert", "Expression Failed: ", \
     #expr, __FILE__, __LINE__ ); \
     BOOST_LOG(rdErrorLog) << "\n\n****\n" << inv << "****\n\n"; throw inv; }

Definition at line 136 of file Invariant.h.

#define UNDER_CONSTRUCTION ( fn   ) 

Value:

Invar::Invariant inv( "Incomplete Code", \
     "This routine is still under development", fn, __FILE__, __LINE__ ); \
     BOOST_LOG(rdErrorLog) << "\n\n****\n" << inv << "****\n\n"; throw inv;

Definition at line 126 of file Invariant.h.


Generated on Tue Oct 7 06:10:11 2008 for RDCode by  doxygen 1.5.5