Loading...
Searching...
No Matches
TautomerFunctor Class Referenceabstract

`#include <tautomer.h>`

Inheritance diagram for TautomerFunctor:
[legend]

## Public Member Functions

virtual | ~TautomerFunctor ()
virtual void | operator() (OBMol *mol)=0

## Detailed Description

Functor for tautomer enumeration algorithm. Subclass this class to write your own functor. This functor will be called for every tautomer that is found. This may include duplicates. Subclass UniqueTautomerFunctor to filter these duplicates.

Example to write all tautomer smiles to std::cout:

class WriteSmilesFunctor : public TautomerFunctor
{
public:
WriteSmilesFunctor()
{
m_conv.SetOutFormat("can");
}
void operator()(OBMol *mol)
{
std::cout << m_conv.WriteString(mol, true) << std::endl;
}
private:
OBConversion m_conv;
};
OpenBabel::OBMol
Molecule Class.
Definition mol.h:121
OpenBabel::TautomerFunctor
Definition tautomer.h:67
OpenBabel::TautomerFunctor::operator()
virtual void operator()(OBMol *mol)=0

This functor can be used in the following way:

OBMol mol;
...
WriteSmilesFunctor functor;
// write all tautomers to std::cout
EnumerateTautomers(mol, functor);
OpenBabel::EnumerateTautomers
void EnumerateTautomers(OBMol *mol, TautomerFunctor &functor)
Definition tautomer.cpp:870

## Constructor & Destructor Documentation

## ~TautomerFunctor()

virtual ~TautomerFunctor | ( |  | ) |

inline virtual

## Member Function Documentation

## operator()()

virtual void operator() | ( | OBMol * | mol | ) |

pure virtual

This function is called every time a tautomer is discovered.

Parameters

  mol | The tautomer.

Implemented in UniqueTautomerFunctor.

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

- tautomer.h