.. oe:namespace:: OEChem



.. meta::
   :keywords: OEHasIdx, HasIdx


.. _OEChem_OEHasIdx:

.. oe:class:: OEHasIdx

   .. oe:api::

      template<class Arg>
      class OEHasIdx : public OESystem::OEUnaryPredicate<Arg>

   This class represents :ref:`OEHasIdx <OEChem_OEHasIdx>` template functor that
   identifies object that provides a ``GetIdx`` method with a specific index.

   .. seealso::

      * :ref:`section_atombondindices_dontdothis` section

   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>`                                                            
   ============================================================ ============================================================ ===========================================================


   The following specializations exist for this template:

   ==================== ====================================================================
   Specialized Functor  Definition                                                          
   ==================== ====================================================================
   OEHasAtomIdx         :ref:`OEHasIdx <OEChem_OEHasIdx>` <:ref:`OEAtomBase <OEChem_OEAtomBase>`>
   OEHasBondIdx         :ref:`OEHasIdx <OEChem_OEHasIdx>` <:ref:`OEBondBase <OEChem_OEBondBase>`>
   OEHasConfIdx         :ref:`OEHasIdx <OEChem_OEHasIdx>` <:ref:`OEConfBase <OEChem_OEConfBase>`>
   ==================== ====================================================================

   .. index::
      single: OEHasAtomIdx
      single: OEHasBondIdx
      single: OEHasConfIdx

   .. oe:method:: Constructors

      .. oe:api::

         OEHasIdx(unsigned int idx)

      Constructs the functor with the internal index number.

   .. oe:method:: operator()

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

         .. oe:api::

            bool operator()(const Arg& arg) const

      .. oe:language:: python

         .. oe:api:: python

            __call__(arg: Arg) -> bool

      Returns ``true``, if the index returned by the 
      ``Arg.GetIdx()`` method  is equivalent to the number  
      with which the functor is constructed.

   .. oe:method:: CreateCopy

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

         .. oe:api::

            OETYPENAME OESystem::OEUnaryFunction<Arg, bool>* CreateCopy() const

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEHasIdx

      Deep copy constructor that returns a copy of the object.
      The memory for the returned :ref:`OEHasIdx <OEChem_OEHasIdx>`
      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. 
