.. include:: ../substitutions

.. oe:namespace:: OESystem

.. meta::
   :keywords: OECount

.. oe:function:: OECount

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

      .. oe:api::

         template<class T>
         unsigned int OECount(OEIter<T>& iter)
         template<class T>
         unsigned int OECount(OEIterBase<T>* iter)

   .. oe:language:: python

      .. oe:api:: python

         OECount(abset: OEAtomBondSet, atompred: OEUnaryAtomPred) -> int
         OECount(abset: OEAtomBondSet, bondpred: OEUnaryBondPred) -> int
         OECount(monomers: OEMonomerSet, pred: OEUnaryMonomerPred) -> int
         OECount(arg1: Union[OEGraphMol,OEMol,OEQMol], arg2: OEUnaryAtomPred) -> int
         OECount(arg1: Union[OEGraphMol,OEMol,OEQMol], arg2: OEUnaryBondPred) -> int
         OECount(arg1: Union[OEGraphMol,OEMol,OEQMol], arg2: OEUnaryGroupPred) -> int
         OECount(arg1: Union[OEGraphMol,OEMol,OEQMol], arg2: OESubSearch,
                 uniquematch: bool = False) -> int

   Count the number of elements in an iterator.

   .. note::

      These templated functions are only available in C++.
      Please see the :oe:func:`OEChem::OECount` functions
      in **OEChem TK**.

   These methods have the following behavior:

   * The OEIter version resets the iterator to the
     first element.

   * The OEIterBase version consumes the iterator.
