#include <obiter.h>
Public Member Functions | |
OBAtomAtomIter () | |
OBAtomAtomIter (OBAtom *atm) | |
OBAtomAtomIter (OBAtom &atm) | |
OBAtomAtomIter (const OBAtomAtomIter &ai) | |
OBAtomAtomIter & | operator= (const OBAtomAtomIter &ai) |
operator bool () const | |
OBAtomAtomIter | operator++ (int) |
OBAtom * | operator-> () const |
OBAtom & | operator * () const |
To facilitate iteration through all neighbors of an atom, without resorting to bond indexes (which may change in the future) or the OBAtom::BeginNbr() and OBAtom::NextNbr() 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_NBORS_OF_ATOM(a,p) for( OBAtomAtomIter a(p); a; a++ )
Here is an example:
#include "obiter.h" #include "mol.h" OBMol mol; FOR_ATOMS_OF_MOL(a, mol) { // The variable a behaves like OBAtom* when used with -> and * but // but needs to be explicitly converted when appearing as a parameter // in a function call - use &*a FOR_NBORS_OF_ATOM(b, &*a) { ... } }
OBAtomAtomIter | ( | ) | [inline] |
OBAtomAtomIter | ( | OBAtom * | atm | ) |
OBAtomAtomIter | ( | OBAtom & | atm | ) |
OBAtomAtomIter | ( | const OBAtomAtomIter & | ai | ) |
OBAtomAtomIter & operator= | ( | const OBAtomAtomIter & | ai | ) |
operator bool | ( | ) | const [inline] |
OBAtomAtomIter operator++ | ( | int | ) |
OBAtom* operator-> | ( | ) | const [inline] |
OBAtom& operator * | ( | ) | const [inline] |