cauldron  0.0.0
 All Classes Namespaces Files Functions Variables Typedefs
Public Member Functions | List of all members
cauldron::Strategy< Value > Class Template Referenceabstract

#include <bases.h>

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

Public Member Functions

virtual Value operator() () const =0
 
virtual Union< Value > operator|| (const Strategy< Value > &strategy) const
 
virtual Union< Value > operator|| (const Union< Value > &strategy) const
 
virtual Filtered< Value > filter (const Requirement< Value > &requirement) const
 
virtual Mapped< Value > map (const Converter< Value > &converter) const
 
virtual std::unique_ptr
< Strategy< Value > > 
clone () const =0
 

Detailed Description

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

Strategies base class.

Hereafter strategy is an object which encapsulates an algorithm for generating specific type of values.

Template Parameters
Valuetype of values generated by strategy.

Member Function Documentation

template<typename Value>
virtual Value cauldron::Strategy< Value >::operator() ( ) const
pure virtual
template<typename Value>
virtual Union<Value> cauldron::Strategy< Value >::operator|| ( const Strategy< Value > &  strategy) const
inlinevirtual

Returns a new strategy that generates values from either original strategy or provided one.

Reimplemented in cauldron::Union< Value >.

template<typename Value>
virtual Union<Value> cauldron::Strategy< Value >::operator|| ( const Union< Value > &  strategy) const
inlinevirtual

Same result as for any other strategy. Basically added for possible overriding with support of strategies' union associativity.

Reimplemented in cauldron::Union< Value >.

template<typename Value>
virtual Filtered<Value> cauldron::Strategy< Value >::filter ( const Requirement< Value > &  requirement) const
inlinevirtual

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 in cauldron::Filtered< Value >.

template<typename Value>
virtual Mapped<Value> cauldron::Strategy< Value >::map ( const Converter< Value > &  converter) const
inlinevirtual

Returns a new strategy that generates values from the strategy modified with provided strategies::Converter instance.

Reimplemented in cauldron::Mapped< Value >.

template<typename Value>
virtual std::unique_ptr<Strategy<Value> > cauldron::Strategy< Value >::clone ( ) const
pure virtual

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