#include <obiter.h>
Public Member Functions | |
| OBAtomBondIter () | |
| OBAtomBondIter (OBAtom *atm) | |
| OBAtomBondIter (OBAtom &atm) | |
| OBAtomBondIter (const OBAtomBondIter &bi) | |
| OBAtomBondIter & | operator= (const OBAtomBondIter &bi) |
| operator bool () const | |
| OBAtomBondIter | operator++ (int) |
| OBBond * | operator-> () const |
| OBBond & | operator * () const |
To facilitate iteration through all bonds on an atom, without resorting to bond indexes (which may change in the future) or the OBAtom::BeginBond() and OBAtom::NextBond() methods which may be deprecated in the future
This has been made significantly easier by a series of macros in the obiter.h header file:
\#define FOR_BONDS_OF_ATOM(b,p) for( OBAtomBondIter b(p); b; b++ )
Here is an example:
#include "obiter.h" #include "mol.h" OBAtom atom; unsigned int tripleBondCount; FOR_BONDS_OF_ATOM(b, atom) { // 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 &*b if (b->GetBO() == 3) tripleBondCount++; }
| OBAtomBondIter | ( | ) | [inline] |
| OBAtomBondIter | ( | OBAtom * | atm | ) |
| OBAtomBondIter | ( | OBAtom & | atm | ) |
| OBAtomBondIter | ( | const OBAtomBondIter & | bi | ) |
| OBAtomBondIter & operator= | ( | const OBAtomBondIter & | bi | ) |
| operator bool | ( | ) | const [inline] |
| OBAtomBondIter operator++ | ( | int | ) |
| OBBond* operator-> | ( | ) | const [inline] |
| OBBond& operator * | ( | ) | const [inline] |