Subsections

 
8.12 OEExprBase

class OEExprBase

OEExprBase is an abstract class which defines an interface through which boolean expressions can test equivalence of nodes (atoms) and edges (bonds) during graph match processes. The expression class interface simplifies what is normally a binary tree representation of attributes which atoms and bonds must (not) have in order to be called equivalent to a corresponding node or edge. Derived classes may be used to extend the graph matching algorithms in OEChem to compare attributes beyond the pre-defined expressions in OEChem. In addition, user-defined expression classes may take full advantage of the arbitrary data storage mechanism which is part of the OEBase class. Expression equivalence could then be performed on dynamic user-defined data extensions to atoms and bonds.

8.12.1 IsEquivalent

virtual const OEFuzzy &IsEquivalent(const OEAtomBase *atom)
virtual const OEFuzzy &IsEquivalent(const OEBondBase *bond)

These pure virtual methods provide a common interface for testing attributes of atoms and bonds. Any method which does not modify an atom or bond may be called in an implementation of an IsEquivalent method. The return value must be one of the OEFuzzy predefined instances of true, false, or maybe. For further details of valid return values for these methods please see the section on the OEFuzzy class.

8.12.2 CreateCopy

virtual OEExprBase *CreateCopy()

This pure virtual copy constructor should return a deep copy of the OEExprBase object. The copy of the object returned is in memory now owned by the user making the function call. It is the responsibility of the programmer to manage the memory created and returned by this method.

8.12.3 GetType

virtual unsigned int GetType()

This pure virtual method is designed to return a unique identifier for each OEExprBase implementation. A listing of type identifiers returned by classes in OEChem which are derived from the OEExprBase class can be found in the OEExprType namespace. User-defined implementations of the OEExprBase class should return value for this method which does not collide with types returned by implementations provided by OEChem.