Classes | Namespaces | Defines | Functions

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.

Classes

class  Invar::Invariant

Namespaces

namespace  Invar

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 106 of file Invariant.h.

#define CHECK_INVARIANT (   expr,
  mess 
)
#define INVARIANT_EXCEPTION_METHOD   1

Definition at line 26 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 125 of file Invariant.h.

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

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

Definition at line 120 of file Invariant.h.

Referenced by RDKit::SLNParse::addAtomToMol(), RDKit::SLNParse::addBranchToMol(), RDCatalog::HierarchCatalog< entryType, paramType, orderType >::addEntry(), RDKit::TDTWriter::close(), RDKit::SDWriter::close(), RDKit::SmilesWriter::close(), RDKit::SLNParse::closeRingBond(), RDKit::countSwapsToInterconvert(), RDGeom::PointND::directionVector(), RDKit::TDTWriter::flush(), RDKit::SDWriter::flush(), RDKit::SmilesWriter::flush(), DistGeom::FourthDimContrib::FourthDimContrib(), RDKit::PeriodicTable::getAtomicWeight(), RDKit::PeriodicTable::getDefaultValence(), RDKit::PeriodicTable::getElementSymbol(), RDDepict::EmbeddedFrag::GetEmbeddedAtom(), RDFeatures::ImplicitFeature< FAMILYMARKER, TYPEMARKER, LOCTYPE >::getLoc(), RDKit::PeriodicTable::getMostCommonIsotope(), RDKit::PeriodicTable::getMostCommonIsotopeMass(), RDKit::PeriodicTable::getNouterElecs(), RDKit::Bond::getProp(), RDKit::PeriodicTable::getRb0(), RDKit::PeriodicTable::getRcovalent(), RDKit::PeriodicTable::getRvdw(), RDKit::PeriodicTable::getValenceList(), RDKit::PeriodicTable::moreElectroNegative(), RDGeom::Point2D::operator[](), RDGeom::Point3D::operator[](), RankAtoms::rankVect(), RDCatalog::Catalog< entryType, orderType >::setCatalogParams(), RDKit::SLNParse::startMol(), RDCatalog::HierarchCatalog< entryType, paramType, orderType >::toStream(), and Queries::Query< int, ConstAtomPtr, needsConversion >::TypeConvert().

#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 140 of file Invariant.h.

Referenced by boost_adaptbx::python::streambuf::streambuf().

#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 130 of file Invariant.h.