.. oe:namespace:: OEChem



.. meta::
   :keywords: OEAtomIsInResidue, AtomIsInResidue


.. _OEChem_OEAtomIsInResidue:

.. oe:class:: OEAtomIsInResidue

   .. oe:api::


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

   This class represents :ref:`OEAtomIsInResidue <OEChem_OEAtomIsInResidue>` functor
   that identifies atoms (:ref:`OEAtomBase <OEChem_OEAtomBase>`) with a given
   residue (:ref:`OEResidue <OEChem_OEResidue>`).

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

            OEAtomIsInResidue(const OEResidue& r)

      .. oe:language:: python

         .. oe:api:: python

            OEAtomIsInResidue(r: OEResidue) -> OEAtomIsInResidue

      Constructs the functor with :ref:`OEResidue <OEChem_OEResidue>` as the
      internally specified residue.

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

         .. oe:api::

            OEAtomIsInResidue(const OEAtomIsInResidue& rhs)

      .. oe:language:: python

         .. oe:api:: python

            OEAtomIsInResidue(rhs: OEAtomIsInResidue) -> OEAtomIsInResidue

      Copy constructor.

   .. 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 atom is in the residue specified as the
      construction argument. This is the same as the value returned by
      :oe:func:`OEChem::OESameResidue` (r, :oe:func:`OEChem::OEAtomGetResidue` (atom) ), 
      where 'r' is the
      functor's construction :ref:`OEResidue <OEChem_OEResidue>` argument.

   .. oe:method:: CreateCopy

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

         .. oe:api::

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

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEAtomIsInResidue

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

     
