.. oe:namespace:: OEChem



.. meta::
   :keywords: OEHasMapIdx, HasMapIdx


.. _OEChem_OEHasMapIdx:

.. oe:class:: OEHasMapIdx

   .. oe:api::


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

   This class represents :ref:`OEHasMapIdx <OEChem_OEHasMapIdx>` functor that identifies
   atoms (:ref:`OEAtomBase <OEChem_OEAtomBase>`) with any or a specific map index.


   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::

            OEHasMapIdx(unsigned int idx = 0)

      .. oe:language:: python

         .. oe:api:: python

            OEHasMapIdx(idx: int = 0) -> OEHasMapIdx

      Constructs the functor with the internal map index.
      With no arguments, this constructs a functor which returns ``true``
      for any atom with a non-zero map index. When constructed with a
      non-zero integer, it constructs a functor which return ``true`` for
      atoms which have the same map index as the constructor argument.

   .. 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 the index returned by the 
      :oe:meth:`OEChem::OEAtomBase::GetMapIdx` method for the given
      :ref:`OEAtomBase <OEChem_OEAtomBase>` object is equivalent to the non-zero index
      number with which the functor is constructed.

      Returns ``true``, if the index returned by the 
      :oe:meth:`OEChem::OEAtomBase::GetMapIdx` method for the given
      :ref:`OEAtomBase <OEChem_OEAtomBase>` object is non-zero when the index
      number with which the functor is constructed is ``0``.

   .. oe:method:: CreateCopy

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

         .. oe:api::

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

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEHasMapIdx

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

