.. oe:namespace:: OEChem



.. meta::
   :keywords: OEConfTestBase, ConfTestBase


.. _OEChem_OEConfTestBase:

.. oe:class:: OEConfTestBase

   .. oe:api::


      class OEConfTestBase

   :ref:`OEConfTestBase <OEChem_OEConfTestBase>` is the abstract base class which
   defines the interface for classes used to determine whether
   consecutive molecules read from single-conformer file-formats are
   combined into multi-conformer molecules.

   The following classes derive from this class:
    * :ref:`OEAbsCanonicalConfTest <OEChem_OEAbsCanonicalConfTest>`
    * :ref:`OEAbsoluteConfTest <OEChem_OEAbsoluteConfTest>`
    * :ref:`OEDefaultConfTest <OEChem_OEDefaultConfTest>`
    * :ref:`OEIsomericConfTest <OEChem_OEIsomericConfTest>`
    * :ref:`OEOmegaConfTest <OEChem_OEOmegaConfTest>`

   .. oe:method:: CombineMols

      .. oe:language:: c++ java csharp

         .. oe:api::

            bool CombineMols(OEMCMolBase& m1, OEMolBase& m2)=0

      .. oe:language:: python

         .. oe:api:: python

            CombineMols(m1: OEMol, m2: Union[OEGraphMol,OEMol,OEQMol]) -> bool

      Adds ``m2`` as a new conformer in the multi-conformer ``m1``
      molecule. Returns a boolean indicating whether this combination
      was successful. This method should only be called if a previous
      call to :oe:meth:`OEChem::OEConfTestBase::CompareMols`
      previously returned ``true``.

   .. oe:method:: CompareMols

      .. oe:language:: c++ java csharp

         .. oe:api::

            bool CompareMols(OEMolBase& m1, OEMolBase& m2) const = 0

      .. oe:language:: python

         .. oe:api:: python

            CompareMols(m1: Union[OEGraphMol,OEMol,OEQMol],
                        m2: Union[OEGraphMol,OEMol,OEQMol]) -> bool

      This is the pure virtual function used to determine if two
      molecules are conformers of the same multi-conformer
      molecule. Users inheriting from this class must define this
      function. Note the molecule which is the second argument is not
      const. This allows the second molecule to be modified as may be
      necessary for it to be part of a multi-conformer molecule. It
      can be assumed that every molecule from an input stream will be
      used as argument 'm2' in this function call at least once.

   .. oe:method:: CreateCopy

      .. oe:language:: c++ java csharp

         .. oe:api::

            OEConfTestBase* CreateCopy() const = 0

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEConfTestBase

      Return a pointer to a copy of the derived object. This must be
      implemented by all derived classes.

   .. oe:method:: HasCompareMols

      .. oe:language:: c++ java csharp

         .. oe:api::

            bool HasCompareMols() const

      .. oe:language:: python

         .. oe:api:: python

            HasCompareMols() -> bool

      Return whether the
      :oe:meth:`OEChem::OEConfTestBase::CompareMols` method has a
      "real" implementation and does not always return ``false``. This
      allows :oe:func:`OEChem::OEReadMolecule` to significantly
      optimize the performance of reading single conformer file
      formats into :ref:`OEMCMolBase <OEChem_OEMCMolBase>` objects by avoiding
      copy operations. By default, this base-class method always
      returns ``true`` to be backwards compatible with sub-classes
      already written before this method was
      added. :oe:meth:`OEChem::OEDefaultConfTest::HasCompareMols` is
      the only **OEChem TK** implementation of this method that
      returns ``false``, allowing significant performance optimization
      for the reading into :ref:`OEMol <OEChem_OEMol>` by default.
