Public Types | |
| typedef FST::Clonable_Impl< Criterion_Counting, CRITERION > | parent_impl |
Public Member Functions | |
| Criterion_Counting (const std::shared_ptr< CRITERION > &inner, const std::shared_ptr< std::atomic< long long > > &count) | |
Constructs the counting decorator around inner, sharing evaluation counts through count. | |
| virtual bool | evaluate (RETURNTYPE &result, const PSubset sub) override |
| counts the evaluation, then delegates to the wrapped criterion; | |
| virtual std::ostream & | print (std::ostream &os) const override |
| delegates to the wrapped criterion's print() – the decorator is invisible in listings | |
| Public Member Functions inherited from FST::Clonable_Impl< Criterion_Counting, CRITERION > | |
| CRITERION * | clone () const override |
| dispatches to the DEEP_KIND mechanism (default CLONE_DEEP: Derived's copy-constructor) | |
| CRITERION * | sharing_clone () const override |
| dispatches to the SHARING_KIND mechanism (default CLONE_INHERIT: defers to Base, which throws by family convention) | |
| CRITERION * | stateless_clone () const override |
| dispatches to the STATELESS_KIND mechanism (default CLONE_INHERIT: defers to Base, which throws by family convention) | |
Private Member Functions | |
| Criterion_Counting (const Criterion_Counting &cc) | |
| deep-clones the wrapped criterion but SHARES the atomic evaluation counter across clones | |
Private Attributes | |
| friend | parent_impl |
| std::shared_ptr< CRITERION > | _inner |
| the wrapped criterion whose evaluate() calls are counted | |
| std::shared_ptr< std::atomic< long long > > | _count |
| evaluation counter, shared across clone()s (threaded-evaluator workers included) | |
Criterion decorator counting evaluate() calls; the counter is shared by clone()s so evaluations performed by threaded-evaluator workers are included
implements clone(); sharing/stateless_clone throw in Criterion
|
inlineoverridevirtual |
counts the evaluation, then delegates to the wrapped criterion;
|
private |
grants Clonable_Impl access to the copy-constructor