RDKit: Invariant.h File Reference

| RDKit Open-source cheminformatics and machine learning.

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

Classes | Namespaces | Macros | Functions
Invariant.h File Reference
`#include <assert.h>`
`#include <string>`
`#include <iostream>`
`#include <stdexcept>`
`#include "BoostStartInclude.h"`
`#include <RDGeneral/RDLog.h>`
`#include "BoostEndInclude.h"`

Go to the source code of this file.

## Classes
class | Invar::Invariant

## Namespaces
| Invar

## Macros
#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 | URANGE_CHECK(x, hi)
#define | TEST_ASSERT(expr)
#define | rdcast static_cast
#define | RDUNUSED_PARAM(x) (void) x;

## Functions
std::ostream & | Invar::operator<< (std::ostream &s, const Invariant &inv)

## Macro Definition Documentation

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

Definition at line 91 of file Invariant.h.

#define CHECK_INVARIANT | ( |  | expr,
|  |  | mess
| ) |  |

Value:
if (!(expr)) { \
Invar::Invariant inv("Invariant Violation", mess, #expr, __FILE__, \
__LINE__); \
BOOST_LOG(rdErrorLog) << "\n\n****\n" << inv << "****\n\n"; \
throw inv; \
}
BOOST_LOG
#define BOOST_LOG(__arg__)
Definition: RDLog.h:87
rdErrorLog
boost::logging::rdLogger * rdErrorLog

Definition at line 99 of file Invariant.h.

Referenced by RDKit::SLNParse::addBranchToMol(), RDKit::appendPackedIntToStream(), RDDataManip::MetricMatrixCalc< vectType, entryType >::calcMetricMatrix(), DistGeom::ChiralSet::ChiralSet(), RDKit::SLNParse::closeRingBond(), RDKit::countSwapsToInterconvert(), RDNumeric::SymmMatrix< TYPE >::getCol(), RDCatalog::HierarchCatalog< entryType, paramType, orderType >::getEntriesOfOrder(), RDNumeric::SymmMatrix< TYPE >::getRow(), RDPickers::MaxMinPicker::lazyPick(), BFGSOpt::minimize(), RDNumeric::multiply(), RDNumeric::SquareMatrix< double >::operator*=(), RDNumeric::SymmMatrix< TYPE >::operator*=(), RDNumeric::SymmMatrix< TYPE >::operator+=(), RDNumeric::SymmMatrix< TYPE >::operator-=(), RDPickers::MaxMinPicker::pick(), boost_adaptbx::python::streambuf::seekpos(), DistGeom::BoundsMatrix::setLowerBound(), DistGeom::BoundsMatrix::setUpperBound(), RDKit::streamReadProps(), and RDNumeric::SymmMatrix< TYPE >::transpose().

#define INVARIANT_EXCEPTION_METHOD 1

Definition at line 36 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; \
}
BOOST_LOG
#define BOOST_LOG(__arg__)
Definition: RDLog.h:87
rdErrorLog
boost::logging::rdLogger * rdErrorLog

Definition at line 115 of file Invariant.h.

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

#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; \
}
BOOST_LOG
#define BOOST_LOG(__arg__)
Definition: RDLog.h:87
rdErrorLog
boost::logging::rdLogger * rdErrorLog

Definition at line 107 of file Invariant.h.

Referenced by RDKit::SLNParse::addAtomToMol(), RDKit::SLNParse::addBranchToMol(), RDKit::FilterHierarchyMatcher::addChild(), RDCatalog::HierarchCatalog< entryType, paramType, orderType >::addEntry(), RDKit::MolBundle::addMol(), RDKit::ExclusionList::addPattern(), RDKit::MultiFPBReader::addReader(), RDNumeric::Vector< TYPE >::assign(), RDNumeric::Matrix< double >::assign(), RDKit::MolDraw2D::atomCoords(), RDKit::MolDraw2D::atomSyms(), SmilesParseOps::CleanupAfterParseError(), RDKit::SLNParse::closeRingBond(), RDKit::countSwapsToInterconvert(), RDKit::describeQuery(), RDGeom::PointND::directionVector(), RDNumeric::Vector< TYPE >::dotProduct(), RDKit::Drawing::DrawingToCairo(), RDKit::MolDraw2Dwx::drawPolygon(), RDKit::SmilesWriter::flush(), RDKit::SDWriter::flush(), RDKit::TDTWriter::flush(), RDKit::PDBWriter::flush(), DistGeom::FourthDimContrib::FourthDimContrib(), RDKit::SparseIntVect< IndexType >::fromString(), RDKit::MolAlign::MolHistogram::get(), RDKit::PeriodicTable::getAbundanceForIsotope(), RDKit::RecursiveStructureQuery::getAtIdx(), RDKit::PeriodicTable::getAtomicWeight(), RDNumeric::Matrix< double >::getCol(), RDKit::MolAlign::LAP::getCost(), RDKit::PeriodicTable::getDefaultValence(), RDKit::PeriodicTable::getElementSymbol(), RDDepict::EmbeddedFrag::GetEmbeddedAtom(), DistGeom::FourthDimContrib::getEnergy(), RDKit::EnumerateLibraryBase::getEnumerator(), DistGeom::FourthDimContrib::getGrad(), RDFeatures::ImplicitFeature< FAMILYMARKER, TYPEMARKER, LOCTYPE >::getLoc(), RDKit::PeriodicTable::getMassForIsotope(), RDKit::FilterMatchOps::And::getMatches(), RDKit::FilterMatchOps::Or::getMatches(), RDKit::FilterMatchOps::Not::getMatches(), RDKit::ExclusionList::getMatches(), RDKit::SubstructLibrary::getMol(), RDKit::SubstructLibrary::getMolecules(), RDKit::SubstructLibrary::getMolHolder(), RDKit::PeriodicTable::getMostCommonIsotope(), RDKit::PeriodicTable::getMostCommonIsotopeMass(), RDKit::PeriodicTable::getNouterElecs(), RDKit::Atom::getOwningMol(), RDKit::Bond::getOwningMol(), RDKit::PeriodicTable::getRb0(), RDKit::PeriodicTable::getRcovalent(), RDNumeric::Matrix< double >::getRow(), RDKit::MolAlign::LAP::getRowSol(), RDKit::PeriodicTable::getRvdw(), RDNumeric::Vector< TYPE >::getVal(), RDNumeric::Matrix< double >::getVal(), RDKit::PeriodicTable::getValenceList(), RDKit::FilterMatchOps::And::hasMatch(), RDKit::FilterMatchOps::Or::hasMatch(), RDKit::FilterMatchOps::Not::hasMatch(), RDKit::ExclusionList::hasMatch(), BFGSOpt::linearSearch(), BFGSOpt::minimize(), RDKit::PeriodicTable::moreElectroNegative(), RDKit::EnumerateLibraryBase::operator bool(), RDGeom::UniformGrid3D::operator&(), RDKit::Canon::SpecialChiralityAtomCompareFunctor::operator()(), RDKit::Canon::SpecialSymmetryAtomCompareFunctor::operator()(), RDKit::Canon::AtomCompareFunctor::operator()(), RDKit::Canon::ChiralAtomCompareFunctor::operator()(), RDNumeric::Vector< TYPE >::operator+=(), RDNumeric::Matrix< double >::operator+=(), RDNumeric::Vector< TYPE >::operator-=(), RDNumeric::Matrix< double >::operator-=(), RDGeom::Point3D::operator[](), RDNumeric::Vector< TYPE >::operator[](), RDGeom::Point2D::operator[](), RDKit::SubstructLibrary::operator[](), Rankers::rankVect(), RDKit::Atom::setAtomMapNum(), RDCatalog::Catalog< entryType, orderType >::setCatalogParams(), RDKit::MMFF::MMFFMolProperties::setMMFFDielectricConstant(), RDKit::MMFF::MMFFMolProperties::setMMFFVariant(), RDKit::FilterHierarchyMatcher::setPattern(), RDKit::Bond::setStereo(), RDNumeric::Vector< TYPE >::setVal(), RDNumeric::Matrix< double >::setVal(), RDKit::SubstructLibrary::size(), RDKit::SLNParse::startMol(), RDCatalog::HierarchCatalog< entryType, paramType, orderType >::toStream(), RDNumeric::Matrix< double >::transpose(), and Queries::Query< int, TargetPtr, needsConversion >::TypeConvert().

#define RANGE_CHECK | ( |  | lo,
|  |  | x,
|  |  | hi
| ) |  |

Value:
if ((lo) > (hi) || (x) < (lo) || (x) > (hi)) { \
std::stringstream errstr; \
errstr << lo << " <= " << x << " <= " << hi; \
Invar::Invariant inv("Range Error", #x, errstr.str().c_str(), __FILE__, \
__LINE__); \
BOOST_LOG(rdErrorLog) << "\n\n****\n" << inv << "****\n\n"; \
throw inv; \
}
BOOST_LOG
#define BOOST_LOG(__arg__)
Definition: RDLog.h:87
rdErrorLog
boost::logging::rdLogger * rdErrorLog

Definition at line 130 of file Invariant.h.

#define rdcast static_cast

Definition at line 189 of file Invariant.h.

#define RDUNUSED_PARAM | ( |  | x | ) | (void) x;

Definition at line 194 of file Invariant.h.

Referenced by RDKit::FilterMatcherBase::Clone(), RDKit::FilterMatchOps::And::copy(), RDKit::FilterMatchOps::Or::copy(), RDKit::FilterMatchOps::Not::copy(), RDKit::SmartsMatcher::copy(), RDKit::ExclusionList::copy(), RDKit::FilterHierarchyMatcher::copy(), RDKit::FilterCatalogParams::getCatalogs(), RDKit::getNumThreadsToUse(), RDKit::FilterCatalogEntry::hasFilterMatch(), RDKit::HasPropWithValueQuery< TargetPtr, std::string >::HasPropWithValueQuery(), BFGSOpt::minimize(), RDKit::streamRead(), RDKit::MolDraw2D::tagAtoms(), RDDataManip::TanimotoDistanceMetric(), RDDataManip::TanimotoSimilarityMetric(), and RDKit::TverskySimilarity().

#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; \
}
BOOST_LOG
#define BOOST_LOG(__arg__)
Definition: RDLog.h:87
rdErrorLog
boost::logging::rdLogger * rdErrorLog

Definition at line 150 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;
BOOST_LOG
#define BOOST_LOG(__arg__)
Definition: RDLog.h:87
Invar::Invariant
Definition: Invariant.h:50
rdErrorLog
boost::logging::rdLogger * rdErrorLog

Definition at line 123 of file Invariant.h.

#define URANGE_CHECK | ( |  | x,
|  |  | hi
| ) |  |

Value:
if (x >= (hi)) { \
std::stringstream errstr; \
errstr << x << " < " << hi; \
Invar::Invariant inv("Range Error", #x, errstr.str().c_str(), __FILE__, \
__LINE__); \
BOOST_LOG(rdErrorLog) << "\n\n****\n" << inv << "****\n\n"; \
throw inv; \
}
BOOST_LOG
#define BOOST_LOG(__arg__)
Definition: RDLog.h:87
rdErrorLog
boost::logging::rdLogger * rdErrorLog

Definition at line 140 of file Invariant.h.

Referenced by RDCatalog::HierarchCatalog< entryType, paramType, orderType >::addEdge(), RDCatalog::HierarchCatalog< entryType, paramType, orderType >::getEntryWithBitId(), RDCatalog::HierarchCatalog< entryType, paramType, orderType >::getEntryWithIdx(), RDCatalog::HierarchCatalog< entryType, paramType, orderType >::getIdOfEntryWithBitId(), DistGeom::BoundsMatrix::getLowerBound(), RDKit::MMFF::MMFFMolProperties::getMMFFAtomType(), RDKit::MMFF::MMFFMolProperties::getMMFFFormalCharge(), RDKit::MMFF::MMFFMolProperties::getMMFFPartialCharge(), DistGeom::BoundsMatrix::getUpperBound(), RDNumeric::SymmMatrix< TYPE >::getVal(), RDKit::MMFF::MMFFMolProperties::isValid(), DistGeom::BoundsMatrix::setLowerBound(), DistGeom::BoundsMatrix::setUpperBound(), and RDNumeric::SymmMatrix< TYPE >::setVal().