.. oe:namespace:: OEChem



.. meta::
   :keywords: OENthAtom, NthAtom


.. _OEChem_OENthAtom:

.. oe:class:: OENthAtom

   .. oe:api::


      class OENthAtom : public OESystem::OEUnaryPredicate<OEChem::OEAtomBase>

   This class represents :ref:`OENthAtom <OEChem_OENthAtom>` functor that
   identifies the Nth atom (:ref:`OEAtomBase <OEChem_OEAtomBase>`) is the molecule.

   The following methods are publicly inherited from :ref:`OEUnaryPredicate <OESystem_OEUnaryPredicate>`:

   ============================================================================== ============================================================================== ===============================================================================
   :oe:meth:`operator()<OESystem::OEUnaryPredicate::operator()>`                  :oe:meth:`CreateCopy<OESystem::OEUnaryPredicate::CreateCopy>`                  :oe:meth:`CreatePredicateCopy<OESystem::OEUnaryPredicate::CreatePredicateCopy>`
   ============================================================================== ============================================================================== ===============================================================================

   The following methods are publicly inherited from :ref:`OEUnaryFunction <OESystem_OEUnaryFunction>`:

   ============================================================ ============================================================ ===========================================================
   :oe:meth:`operator()<OESystem::OEUnaryFunction::operator()>` :oe:meth:`CreateCopy<OESystem::OEUnaryFunction::CreateCopy>`                                                            
   ============================================================ ============================================================ ===========================================================

   .. oe:method:: Constructors

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

         .. oe:api::

            OENthAtom(unsigned int n, unsigned int start = 0)

      .. oe:language:: python

         .. oe:api:: python

            OENthAtom(n: int, start: int = 0) -> OENthAtom

      Constructs the functor with the Nth atom specified by 'n' and the
      starting atom specified by 'start'.

   .. oe:method:: operator()

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

         .. oe:api::

            bool operator()(const OEAtomBase& atom) const

      .. oe:language:: python

         .. oe:api:: python

            __call__(atom: OEAtomBase) -> bool

      Returns ``true``, if iteration over the atoms in the molecule makes
      the 'atom' the Nth atom in the molecule starting with the first
      atom being the 'start' atom.

   .. oe:method:: CreateCopy

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

         .. oe:api::

            OESystem::OEUnaryFunction<OEChem::OEAtomBase , bool>* CreateCopy() const

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OENthAtom

      Deep copy constructor that returns a copy of the object.
      The memory for the returned :ref:`OENthAtom <OEChem_OENthAtom>`
      object is dynamically allocated  and owned by the caller.

      .. oe:language:: c++ 

         The returned copy should be deallocated using C++
         delete operator in order to prevent a memory leak. 
