
.. include:: ../substitutions

.. oe:namespace:: OEProton

.. meta::
   :keywords: OEEnumerateFormalCharges

.. oe:function:: OEEnumerateFormalCharges

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

      .. oe:api::

         OESystem::OEIterBase<OEChem::OEMolBase>* OEEnumerateFormalCharges(const OEChem::OEMolBase& mol,
                                                                           const OEFormalChargeOptions& formalChargeOptions = OEFormalChargeOptions())
         OESystem::OEIterBase<OEChem::OEMolBase>* OEEnumerateFormalCharges(const OEChem::OEMCMolBase& mol,
                                                                           const OEFormalChargeOptions& formalChargeOptions = OEFormalChargeOptions())

   .. oe:language:: python

      .. oe:api:: python

         OEEnumerateFormalCharges(mol: OEMol,
                                  formalChargeOptions: OEFormalChargeOptions = OEFormalChargeOptions()) -> Iterable[Union[OEGraphMol, OEMol, OEQMol]]
         OEEnumerateFormalCharges(mol: Union[OEGraphMol,OEQMol],
                                  formalChargeOptions: OEFormalChargeOptions = OEFormalChargeOptions()) -> Iterable[Union[OEGraphMol, OEMol, OEQMol]]

   This function takes a const input molecule and variants of that molecule different
   formal charges are
   returned as an ``OESystem::OEIterBase<OEChem::OEMolBase> *``.  Options are set with an
   :ref:`OEFormalChargeOptions <OEProton_OEFormalChargeOptions>`, a parameter that is not required.
   See the corresponding documentation for descriptions of options.

   .. warning::
      The following version of OEEnumerateFormalCharges is deprecated.
      Use the above :ref:`OEFormalChargeOptions <OEProton_OEFormalChargeOptions>` version instead.

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

      .. oe:api::

         unsigned int OEEnumerateFormalCharges(OEChem::OEMolBase& mol,
                                               OEMolFunctionBase& mfb,
                                               bool verbose = false)

   .. oe:language:: python

      .. oe:api:: python

         OEEnumerateFormalCharges(mol: Union[OEGraphMol,OEMol,OEQMol],
                                  mfb: OEMolFunctionBase, verbose: bool = False) -> int



   This function has three arguments.  The first is the non-const
   molecule whose formal charges are to be enumerated.  For details of
   the enumeration process, please see :ref:`chapter_pkatypertheory`.
   The second argument is a functor call-back.  The functor's
   ``operator()`` is called with each new protonation state
   enumerated.  The enumeration will continue until the functor
   returns false or until the enumeration is complete.  The third
   argument determines if verbose atom-type information should be
   written to standard out.  The function will return the total number
   of states which were enumerated.

