#include <openbabel/obiter.h>
Public Member Functions | |
| OBMolRingIter () | |
| OBMolRingIter (OBMol *mol) | |
| OBMolRingIter (OBMol &mol) | |
| OBMolRingIter (const OBMolRingIter &ri) | |
| ~OBMolRingIter () | |
| OBMolRingIter & | operator= (const OBMolRingIter &ri) |
| operator bool () const | |
| OBMolRingIter & | operator++ () |
| OBMolRingIter | operator++ (int) |
| OBRing * | operator-> () const |
| OBRing & | operator * () const |
Calling iterator classes has been made significantly easier by a series of macros in the obiter.h header file:
\#define FOR_RINGS_OF_MOL(r,m) for( OBMolRingIter r(m); r; ++r )
Here is an example:
#include <openbabel/obiter.h> #include <openbabel/mol.h> OBMol mol; FOR_RINGS_OF_MOL(r, mol) { // The variable r behaves like OBRing* when used with -> and * but // but needs to be explicitly converted when appearing as a parameter // in a function call - use &*r }
| OBMolRingIter | ( | ) | [inline] |
| OBMolRingIter | ( | OBMol * | mol | ) |
| OBMolRingIter | ( | OBMol & | mol | ) |
| OBMolRingIter | ( | const OBMolRingIter & | ri | ) |
| ~OBMolRingIter | ( | ) | [inline] |
| OBMolRingIter & operator= | ( | const OBMolRingIter & | ri | ) |
| operator bool | ( | ) | const [inline] |
| OBMolRingIter & operator++ | ( | ) |
Preincrement -- advance to the next ring (if any) and return.
| OBMolRingIter operator++ | ( | int | ) |
Postincrement -- return the current state and advance to the next ring.
| OBRing* operator-> | ( | ) | const [inline] |
| OBRing& operator * | ( | ) | const [inline] |