11.9 OEUnaryPredicate

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

virtual bool operator()(const Arg&) const = 0
virtual OEUnaryFunction<Arg,Result> *CreateCopy() = 0

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. 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 operator() of a predicate does not modify the object it takes as an argument and itself is not modified by the evaluation. These conventions guarentee that the result of a series of predicate evaluations will not be order dependent.