.. oe:namespace:: OEBio

.. meta::
   :keywords: OEHasAlternateLocation, HasAlternateLocation


.. _OEBio_OEHasAlternateLocation:

.. oe:class:: OEHasAlternateLocation

   .. oe:api::

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

   .. seealso::

      :ref:`section_predicates_reside_data_functors` section

   This class represents `OEHasAlternateLocation`, a functor that identifies atoms (:ref:`OEAtomBase <OEChem_OEAtomBase>`) with an alternate location code.

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

            OEHasAlternateLocation(const OEHasAlternateLocation& rhs)
            OEHasAlternateLocation(char confCode = '\0',
                                   bool acceptBlanks = false,
                                   bool caseSensitive = true)

      .. oe:language:: python

         .. oe:api:: python

            OEHasAlternateLocation(confCode: str = '\0',
                                   acceptBlanks: bool = False,
                                   caseSensitive: bool = True) -> OEHasAlternateLocation
            OEHasAlternateLocation(rhs: OEHasAlternateLocation) -> OEHasAlternateLocation

      Default and copy constructors.

      If a non-blank ``char`` is supplied, atoms with that alternate location code will be selected when the object is used in a predicate expression.
      If a non-blank ``char`` is not supplied, atoms with any non-blank alternate location code will be selected.

      If ``acceptBlanks`` is ``true``, then atoms with blank alternate location codes will also be selected.
      If ``caseSensitive`` is ``false``, then both upper- and lower-case versions of the ``confCode`` parameter will
      be tried in the match.

   .. oe:method:: operator()

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

         .. oe:api::

            bool operator()(const OEChem::OEAtomBase& atom) const

      .. oe:language:: python

         .. oe:api:: python

            __call__(atom: OEAtomBase) -> bool

      Returns ``true``, if the :ref:`OEAtomBase <OEChem_OEAtomBase>` has a :ref:`OEResidue <OEChem_OEResidue>`
      and :oe:meth:`OEChem::OEResidue::GetAlternateLocation` returns a ``char`` that matches
      the values used in the :oe:meth:`OEBio::OEHasAlternateLocation::Constructors`.

   .. oe:method:: CreateCopy

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

         .. oe:api::

            OESystem::OEUnaryPredicate<OEChem::OEAtomBase>::base_type* CreateCopy() const

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEHasAlternateLocation

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