#include <openbabel/obiter.h>
Public Member Functions | |
OBMolPairIter () | |
OBMolPairIter (OBMol *mol) | |
OBMolPairIter (OBMol &mol) | |
OBMolPairIter (const OBMolPairIter &ai) | |
~OBMolPairIter () | |
OBMolPairIter & | operator= (const OBMolPairIter &ai) |
operator bool () const | |
OBMolPairIter & | operator++ () |
std::vector< unsigned int > | operator* () const |
This has been made significantly easier by a series of macros in the obiter.h header file:
\#define FOR_PAIRS_OF_MOL(p,m) for( OBMolPairIter p(m); p; p++ )
Here is an example:
#include <openbabel/obiter.h> #include <openbabel/mol.h> OBMol mol; OBAtom *a, *b; double rab; FOR_PAIRS_OF_MOL(p, mol) { // The variable b behaves like OBBond* when used with -> and * but // but needs to be explicitly converted when appearing as a parameter // in a function call - use &*p a = mol.GetAtom(p->first); b = mol.GetAtom(p->second); rab = a->GetDistance(b); }
OBMolPairIter | ( | ) | [inline] |
OBMolPairIter | ( | OBMol * | mol | ) |
OBMolPairIter | ( | OBMol & | mol | ) |
OBMolPairIter | ( | const OBMolPairIter & | ai | ) |
~OBMolPairIter | ( | ) | [inline] |
OBMolPairIter & operator= | ( | const OBMolPairIter & | ai | ) |
operator bool | ( | ) | const [inline] |
OBMolPairIter & operator++ | ( | ) |
Preincrement -- advance to the next 1-4 atom pair and return.
std::vector<unsigned int> operator* | ( | ) | const [inline] |