Open Babel  3.0
Public Member Functions | List of all members
OBMolRingIter Class Reference

#include <openbabel/obiter.h>

Public Member Functions

 OBMolRingIter ()
 
 OBMolRingIter (OBMol *mol)
 
 OBMolRingIter (OBMol &mol)
 
 OBMolRingIter (const OBMolRingIter &ri)
 
 ~OBMolRingIter ()
 
OBMolRingIteroperator= (const OBMolRingIter &ri)
 
 operator bool () const
 
OBMolRingIteroperator++ ()
 
OBMolRingIter operator++ (int)
 
OBRingoperator-> () const
 
OBRingoperator* () const
 

Detailed Description

Iterate over all rings in an OBMol.

Since
version 2.1

To facilitate iteration through all rings in a molecule, without resorting to ring indexes (which may change in the future) a variety of iterator classes and methods are provided. One word of warning is that these iterator methods automatically call OBMol::FindSSSR() which may involve a significant performance hit on large molecules.

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/mol.h>
{
// 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
}

Constructor & Destructor Documentation

◆ OBMolRingIter() [1/4]

OBMolRingIter ( )
inline

◆ OBMolRingIter() [2/4]

OBMolRingIter ( OBMol mol)

◆ OBMolRingIter() [3/4]

OBMolRingIter ( OBMol mol)

◆ OBMolRingIter() [4/4]

OBMolRingIter ( const OBMolRingIter ri)

◆ ~OBMolRingIter()

~OBMolRingIter ( )
inline

Member Function Documentation

◆ operator=()

OBMolRingIter & operator= ( const OBMolRingIter ri)

◆ operator bool()

operator bool ( ) const
inline
Returns
Whether the iterator can advance (i.e., there are more rings)

◆ operator++() [1/2]

OBMolRingIter & operator++ ( )

Preincrement – advance to the next ring (if any) and return.

Referenced by OBMolRingIter::operator++().

◆ operator++() [2/2]

OBMolRingIter operator++ ( int  )

Postincrement – return the current state and advance to the next ring.

◆ operator->()

OBRing* operator-> ( ) const
inline
Returns
A pointer to the current ring (if any)

◆ operator*()

OBRing& operator* ( ) const
inline
Returns
A reference to the current ring (if any)

The documentation for this class was generated from the following files: