.. oe:namespace:: OESystem


.. meta::
   :keywords: OEUnaryPredicate, UnaryPredicate


.. _OESystem_OEUnaryPredicate:

.. oe:class:: OEUnaryPredicate

   .. oe:api::


      template<class Arg>
      class OEUnaryPredicate : public OEUnaryFunction<Arg, bool>

   This class represents `OEUnaryPredicate`.

   This abstract base-class defines predicates in *OEChem*. Predicates
   are a special class of functors which, by convention, has several
   restriction. These restrictions make predicates predictable and
   reliable. To the degree possible, these restrictions are enforced by
   the API. :oe:meth:`OESystem::OEUnaryPredicate::CreateCopy` is a virtual
   constructor which allows copying of concrete derived objects using a
   reference to this base class.

   By definition, a predicates is a functor which always return a
   boolean. By convention, the
   :oe:meth:`OESystem::OEUnaryPredicate::operator()` of a predicate does
   not modify the object it takes as an argument and itself is not
   modified by the evaluation. These conventions guarantee that the
   result of a series of predicate evaluations will not be order
   dependent.

   The following methods are publicly inherited from :ref:`OEUnaryFunction <OESystem_OEUnaryFunction>`:

   ============================================================ ============================================================ ===========================================================
   :oe:meth:`operator()<OESystem::OEUnaryFunction::operator()>` :oe:meth:`CreateCopy<OESystem::OEUnaryFunction::CreateCopy>`
   ============================================================ ============================================================ ===========================================================


   The following atom predicate classes classes derive from this class:

    * :ref:`OEAtomIsInAgent <OEChem_OEAtomIsInAgent>`
    * :ref:`OEAtomIsInChain <OEChem_OEAtomIsInChain>`
    * :ref:`OEAtomIsInProduct <OEChem_OEAtomIsInProduct>`
    * :ref:`OEAtomIsInReactant <OEChem_OEAtomIsInReactant>`
    * :ref:`OEAtomIsInResidue <OEChem_OEAtomIsInResidue>`
    * :ref:`OEAtomIsInRing <OEChem_OEAtomIsInRing>`
    * :ref:`OEAtomMatchResidue <OEBio_OEAtomMatchResidue>`
    * :ref:`OEHasAlphaBetaUnsat <OEChem_OEHasAlphaBetaUnsat>`
    * :ref:`OEHasAlternateLocation <OEBio_OEHasAlternateLocation>`
    * :ref:`OEHasAnisou <OEChem_OEHasAnisou>`
    * :ref:`OEHasAtomicNum <OEChem_OEHasAtomicNum>`
    * :ref:`OEHasAtomName <OEChem_OEHasAtomName>`
    * :ref:`OEHasAtomStereoSpecified <OEChem_OEHasAtomStereoSpecified>`
    * :ref:`OEHasChainID <OEChem_OEHasChainID>`
    * :ref:`OEHasFormalCharge <OEChem_OEHasFormalCharge>`
    * :ref:`OEHasFragmentNumber <OEChem_OEHasFragmentNumber>`
    * :ref:`OEHasHvyDegree <OEChem_OEHasHvyDegree>`
    * :ref:`OEHasIdx <OEChem_OEHasIdx>`
    * :ref:`OEHasMapIdx <OEChem_OEHasMapIdx>`
    * :ref:`OEHasPDBAtomIndex <OEBio_OEHasPDBAtomIndex>`
    * :ref:`OEHasResidueNumber <OEChem_OEHasResidueNumber>`
    * :ref:`OEHasSecondaryStructure <OEBio_OEHasSecondaryStructure>`
    * :ref:`OEIsAlphaCarbon <OEBio_OEIsAlphaCarbon>`
    * :ref:`OEIsAromaticAtom <OEChem_OEIsAromaticAtom>`
    * :ref:`OEIsAtomHybridization <OEChem_OEIsAtomHybridization>`
    * :ref:`OEIsBackboneAtom <OEBio_OEIsBackboneAtom>`
    * :ref:`OEIsCAlpha <OEChem_OEIsCAlpha>`
    * :ref:`OEIsCarbon <OEChem_OEIsCarbon>`
    * :ref:`OEIsChiralAtom <OEChem_OEIsChiralAtom>`
    * :ref:`OEIsColorAtomPred <OEShape_OEIsColorAtomPred>`
    * :ref:`OEIsHalide <OEChem_OEIsHalide>`
    * :ref:`OEIsHalogen <OEChem_OEIsHalogen>`
    * :ref:`OEIsHeavy <OEChem_OEIsHeavy>`
    * :ref:`OEIsHetero <OEChem_OEIsHetero>`
    * :ref:`OEIsHydrogen <OEChem_OEIsHydrogen>`
    * :ref:`OEIsInvertibleNitrogen <OEChem_OEIsInvertibleNitrogen>`
    * :ref:`OEIsMetal <OEChem_OEIsMetal>`
    * :ref:`OEIsNitrogen <OEChem_OEIsNitrogen>`
    * :ref:`OEIsNonRingAtomDoubleBondedToRing <OEChem_OEIsNonRingAtomDoubleBondedToRing>`
    * :ref:`OEIsNucleicAcidBase <OEBio_OEIsNucleicAcidBase>`
    * :ref:`OEIsNucleicAcidPhosphate <OEBio_OEIsNucleicAcidPhosphate>`
    * :ref:`OEIsNucleicAcidSugar <OEBio_OEIsNucleicAcidSugar>`
    * :ref:`OEIsOxygen <OEChem_OEIsOxygen>`
    * :ref:`OEIsPhosphorus <OEChem_OEIsPhosphorus>`
    * :ref:`OEIsPolar <OEChem_OEIsPolar>`
    * :ref:`OEIsPolarHydrogen <OEChem_OEIsPolarHydrogen>`
    * :ref:`OEIsRGroup <OEChem_OEIsRGroup>`
    * :ref:`OEIsSulfur <OEChem_OEIsSulfur>`
    * :ref:`OEIsValidAtomValence <OEChem_OEIsValidAtomValence>`
    * :ref:`OEIsValidMDLAtomValence <OEChem_OEIsValidMDLAtomValence>`
    * :ref:`OEIsWater <OEBio_OEIsWater>`

    The following bond predicate classes derive from this class:

    * :ref:`OEBondIsInChain <OEChem_OEBondIsInChain>`
    * :ref:`OEBondIsInRing <OEChem_OEBondIsInRing>`
    * :ref:`OEHasBondStereoSpecified <OEChem_OEHasBondStereoSpecified>`
    * :ref:`OEHasOrder <OEChem_OEHasOrder>`
    * :ref:`OEIsAromaticBond <OEChem_OEIsAromaticBond>`
    * :ref:`OEIsChiralBond <OEChem_OEIsChiralBond>`
    * :ref:`OEIsRotor <OEChem_OEIsRotor>`

    The following template predicate classes derive from this class:

    * :ref:`OEIdxSelected <OEChem_OEIdxSelected>`
    * :ref:`OEIsMember <OEChem_OEIsMember>`
    * :ref:`OEIsMemberPtr <OEChem_OEIsMemberPtr>`
    * :ref:`OEIsMember <OEChem_OEIsMember>`
    * :ref:`OEIsMemberPtr <OEChem_OEIsMemberPtr>`

    * :ref:`OEMatchFunc <OEChem_OEMatchFunc>`
    * :ref:`OENthAtom <OEChem_OENthAtom>`
    * :ref:`OEPartPredT <OEChem_OEPartPredT>`

    * :ref:`IsFalse <OESystem_IsFalse>`
    * :ref:`IsTrue <OESystem_IsTrue>`

    * :ref:`OEAnd <OESystem_OEAnd>`
    * :ref:`OENot <OESystem_OENot>`
    * :ref:`OEOr <OESystem_OEOr>`
    * :ref:`OEUnaryFalse <OESystem_OEUnaryFalse>`


   .. oe:language:: python java csharp

      The following specializations exist for this template:

      ==================== =====================================================
      OEUnaryBasePred      OESystem::OEUnaryPredicate< OESystem::OEBase >
      OEUnaryAtomPred      OESystem::OEUnaryPredicate< OEChem::OEAtomBase >
      OEUnaryBondPred      OESystem::OEUnaryPredicate< OEChem::OEBondBase >
      OEUnaryConfPred      OESystem::OEUnaryPredicate< OEChem::OEConfBase >
      OEUnaryMolBasePred   OESystem::OEUnaryPredicate< OEChem::OEMolBase >
      OEUnaryGraphMolPred  OESystem::OEUnaryPredicate< OEChem::OEGraphMol >
      ==================== =====================================================

   .. oe:method:: operator()

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

         .. oe:api::

            bool operator()(const Arg& a) const = 0

      .. oe:language:: python

         .. oe:api:: python

            __call__(a: Arg) -> bool

   .. oe:method:: CreateCopy

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

         .. oe:api::

            base_type* CreateCopy() const = 0

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEUnaryPredicate

   .. oe:method:: CreatePredicateCopy

      .. oe:api::

         OEFORCEINLINE OEUnaryPredicate<Arg> * CreatePredicateCopy() const

