reductor_fn< ReducingFnT, InitialStateT, InputTs > Struct Template Reference

Function object that performs a reduction using a reducing function of type ReducingFnT, an initial state of type of type InitialStateT and inputs of types InputTs.... More...

#include <atria/xform/reductor.hpp>

Public Types

using base_t = reductor_fn_base< ReducingFnT, estd::result_of_t< ReducingFnT(InitialStateT, InputTs...)>, InputTs... >
 
- Public Types inherited from reductor_fn_base< ReducingFnT, estd::result_of_t< ReducingFnT(InitialStateT, InputTs...)>, InputTs... >
using reducing_fn_type = ReducingFnT
 
using state_type = estd::result_of_t< ReducingFnT(InitialStateT, InputTs...)>
 
using complete_type = estd::decay_t< decltype(state_complete(std::declval< state_type >()))>
 

Public Member Functions

template<typename ReducingFnT2 , typename InitialStateT2 , typename... InputTs2>
 reductor_fn (ReducingFnT2 &&step, InitialStateT2 &&state, InputTs2 &&...ins)
 
- Public Member Functions inherited from reductor_fn_base< ReducingFnT, estd::result_of_t< ReducingFnT(InitialStateT, InputTs...)>, InputTs... >
 operator bool () const
 Returns whether the reductor_fn will produce more values. More...
 
complete_type complete () const &
 Completes and returns the state of the reduction. More...
 
complete_type complete ()&&
 
complete_type current () const &
 Peeks at the current visible state of the reduction. More...
 
complete_type current ()&&
 
void current (T &&x)
 
reductor_fn_baseoperator() (InputTs2 &&...ins)&
 Evaluates the next step of the reduction, passing the inputs ins to the reducing function. More...
 
reductor_fn_base operator() (InputTs2 &&...ins) const &
 
reductor_fn_base && operator() (InputTs2 &&...ins)&&
 

Additional Inherited Members

- Protected Member Functions inherited from reductor_fn_base< ReducingFnT, estd::result_of_t< ReducingFnT(InitialStateT, InputTs...)>, InputTs... >
 reductor_fn_base (ReducingFnT2 &&step, StateT2 &&state)
 

Detailed Description

template<typename ReducingFnT, typename InitialStateT, typename... InputTs>
struct atria::xform::reductor_fn< ReducingFnT, InitialStateT, InputTs >

Function object that performs a reduction using a reducing function of type ReducingFnT, an initial state of type of type InitialStateT and inputs of types InputTs....

The function object can be called with arguments converibles to InputTs... to step the reduction. If the reductor_fn object is const, it will return a new value representing the advanced state. Otherwise it performs the reduction in place and returns a reference to itself. See reductor_fn_base for details on the interface.

This object requires an initial input to be pased to the constructor. If no input is available at construction time, use empty_reductor_fn instead.

Definition at line 149 of file reductor.hpp.


The documentation for this struct was generated from the following file:
Fork me on GitHub