TautomerFunctor Class Reference

#include <tautomer.h>

List of all members.

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.

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

 class WriteSmilesFunctor : public TautomerFunctor
     WriteSmilesFunctor() : foundTautomer(false)

     void operator()(OBMol *mol)
       foundTautomer = true;
       std::cout << m_conv.WriteString(mol);

     bool foundTautomer;

     OBConversion m_conv;

This functor can be used in the following way:

 OBMol mol;
 WriteSmilesFunctor functor;
 // write all tautomers to std::cout
 EnumerateTautomers(mol, functor);
 // write the original smiles if there are no tautomers found
 if (!functor.foundTautomers) {
   OBConversion conv;
   std::cout << conv.WriteString(&mol);

Constructor & Destructor Documentation

virtual ~TautomerFunctor (  )  [inline, virtual]

Member Function Documentation

virtual void operator() ( OBMol mol  )  [pure virtual]

This function is called every time a tautomer is discovered.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines