.. oe:namespace:: OEBio

.. meta::
   :keywords: OEAltLocationState, AltLocationState


.. _OEBio_OEAltLocationState:

.. oe:class:: OEAltLocationState

   .. oe:api::


      class OEAltLocationState

   This class represents `OEAltLocationState`, an abstraction of the internal :ref:`OEAltLocation <OEBio_OEAltLocation>`
   selection state of an :ref:`OEAltLocationFactory <OEBio_OEAltLocationFactory>`. It is designed for ease of use with collection classes
   and to support serialization.

   The following :ref:`OEAltLocationFactory <OEBio_OEAltLocationFactory>` methods get or set an :ref:`OEAltLocationState <OEBio_OEAltLocationState>`:

   ============================================================================== ============================================================================== ==============================================================================
   :oe:meth:`GetState<OEBio::OEAltLocationFactory::GetState>`                     :oe:meth:`SetState<OEBio::OEAltLocationFactory::SetState>`                     :oe:meth:`MakeAltMol<OEBio::OEAltLocationFactory::MakeAltMol>`                
   ============================================================================== ============================================================================== ==============================================================================

   .. oe:method:: Constructors

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

         .. oe:api::

            OEAltLocationState()
            OEAltLocationState(const std::string& hex)
            OEAltLocationState(const OEAltLocationState& state)

      .. oe:language:: python

         .. oe:api:: python

            OEAltLocationState() -> OEAltLocationState
            OEAltLocationState(hex: str) -> OEAltLocationState
            OEAltLocationState(state: OEAltLocationState) -> OEAltLocationState

      Default and copy constructors.

      If no arguments are supplied, the constructed object is uninitialized and will return ``false``
      when :oe:meth:`operator bool<OEBio::OEAltLocationState::operator bool>` is called.

      If a ``string`` is supplied, then an object is constructed to represent the state described by the string.
      Strings appropriate for use with this method are generated by :oe:meth:`OEBio::OEAltLocationState::ToHexString`.
      This constructor is used when reconstituting the serialized state of an :ref:`OEAltLocationFactory <OEBio_OEAltLocationFactory>` prior to
      providing the resulting :oe:cls:`OEAltLocationState<OEBio::OEAltLocationState>` to :oe:meth:`OEBio::OEAltLocationFactory::MakeAltMol`.

      If an :oe:cls:`OEAltLocationState<OEBio::OEAltLocationState>` is supplied, an object is constructed that is identical to the input.

   .. oe:method:: operator=
      :language: c++

      .. oe:api::

         OEAltLocationState &operator=(const OEAltLocationState &state)

      Assignment -- sets this state to match the supplied :ref:`OEAltLocationState <OEBio_OEAltLocationState>`.

      .. oe:api:

         OEAltLocationState &operator=(OEChem::OEAltLocationStateImpl *newImpl)

      Assignment operator.


   .. oe:method:: operator bool

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

         .. oe:api::

            operator bool() const

      .. oe:language:: python

         .. oe:api:: python

            IsValid() -> bool

      Returns ``true`` if the state has been initialized (constructed from a ``string`` argument or from another state that has been initialized).
      Otherwise, returns ``false``.

   .. oe:method:: ToHexString

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

         .. oe:api::

            bool ToHexString(std::string& hex) const

      .. oe:language:: python

         .. oe:api:: python

            ToHexString() -> str

      Generate a text string that describes the state. Used when serializing the state of an :ref:`OEAltLocationFactory <OEBio_OEAltLocationFactory>`.
