Iterate over all bonds in an OBMol in a breadth-first search (BFS)
More...
#include <openbabel/obiter.h>
List of all members.
Detailed Description
Iterate over all bonds in an OBMol in a breadth-first search (BFS)
- Since:
- version 2.3
To facilitate iteration through all bonds in a molecule, without resorting to bond indexes (which will change in the future), a variety of iterator methods are provided.
This class provides a breadth-first search ordering of bonds. When one connected component is exhausted, the iterator will start at another until all bonds are visited. No guarantee is made as to the ordering of iteration through connected components.
The iterator maintains an internal queue and list of visited atoms. As such it may not be appropriate for memory-constrained situations when iterating through large molecules.
Use of this iterator has been made significantly easier by a series of macros in the obiter.h header file:
Here is an example:
Constructor & Destructor Documentation
Member Function Documentation
operator bool |
( |
) |
const [inline] |
- Returns:
- Whether the iterator can still advance (i.e., visit more atoms)
Postincrement -- return the current atom and advance to the next atom.
OBBond* operator-> |
( |
) |
const [inline] |
- Returns:
- a pointer to the current atom
OBBond& operator* |
( |
) |
const [inline] |
- Returns:
- a reference to the current atom
int CurrentDepth |
( |
) |
const |
- Returns:
- the current depth of the iterator
- Since:
- version 2.2
The documentation for this class was generated from the following files: