cauldron  0.0.0
 All Classes Namespaces Files Functions Variables Typedefs
Public Member Functions | Protected Attributes | List of all members
cauldron::Filtered< Value > Class Template Reference

#include <bases.h>

Inheritance diagram for cauldron::Filtered< Value >:
Inheritance graph
[legend]
Collaboration diagram for cauldron::Filtered< Value >:
Collaboration graph
[legend]

Public Member Functions

 Filtered (const Strategy< Value > &strategy, const Sieve< Value > &sieve)
 
 Filtered (const Filtered< Value > &strategy)
 
Filtered< Value > filter (const Requirement< Value > &requirement) const override
 
Value operator() () const override
 
- Public Member Functions inherited from cauldron::CloneHelper< Value, Filtered< Value > >
std::unique_ptr< Strategy
< Value > > 
clone () const override
 
- Public Member Functions inherited from cauldron::Strategy< Value >
virtual Union< Value > operator|| (const Strategy< Value > &strategy) const
 
virtual Union< Value > operator|| (const Union< Value > &strategy) const
 
virtual Mapped< Value > map (const Converter< Value > &converter) const
 

Protected Attributes

std::unique_ptr< Strategy
< Value > > 
strategy_
 
Sieve< Value > sieve_
 

Detailed Description

template<typename Value>
class cauldron::Filtered< Value >

Strategy which filters out values that satisfies defined strategies::Requirement instances.

Hereafter a requirement is an unary predicate .

Template Parameters
Valuetype of values generated by strategy.

Constructor & Destructor Documentation

template<typename Value >
cauldron::Filtered< Value >::Filtered ( const Strategy< Value > &  strategy,
const Sieve< Value > &  sieve 
)
inlineexplicit
template<typename Value >
cauldron::Filtered< Value >::Filtered ( const Filtered< Value > &  strategy)
inline

Default copy constructor doesn't fit since we're using std::unique_ptr as class member which is not copyable.

Member Function Documentation

template<typename Value >
Filtered<Value> cauldron::Filtered< Value >::filter ( const Requirement< Value > &  requirement) const
inlineoverridevirtual

Returns a new strategy that generates values from the strategy which satisfy provided strategies::Requirement instance.

Note that if the requirement is too hard to satisfy this might result in failing with OutOfCycles.

Reimplemented from cauldron::Strategy< Value >.

template<typename Value >
Value cauldron::Filtered< Value >::operator() ( ) const
inlineoverridevirtual

Generates value that satisfies defined strategies::Requirement instances.

Exceptions
strategies::OutOfCycles

Implements cauldron::Strategy< Value >.

Member Data Documentation

template<typename Value >
std::unique_ptr<Strategy<Value> > cauldron::Filtered< Value >::strategy_
protected
template<typename Value >
Sieve<Value> cauldron::Filtered< Value >::sieve_
protected

The documentation for this class was generated from the following file: