.. oe:namespace:: OEChem



.. meta::
   :keywords: OEHasAtomName, HasAtomName


.. _OEChem_OEHasAtomName:

.. oe:class:: OEHasAtomName

   .. oe:api::


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

   This class represents :ref:`OEHasAtomName <OEChem_OEHasAtomName>` functor
   that identifies atoms (:ref:`OEAtomBase <OEChem_OEAtomBase>`) with a specific name.

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

            OEHasAtomName(const char* name, const bool trimspaces = false)

      .. oe:language:: python

         .. oe:api:: python

            OEHasAtomName(name: str, trimspaces: bool = False) -> OEHasAtomName

      Constructs the functor with the provided name. The trimspaces allows matching atoms with names by first trimming off white spaces.

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

   .. oe:method:: CreateCopy

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

         .. oe:api::

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

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEHasAtomName

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