reductor_fn_base< ReducingFnT, StateT, InputTs > Struct Template Reference

Common reductor interface. More...

#include <atria/xform/reductor.hpp>

Public Types

using reducing_fn_type = ReducingFnT
 
using state_type = StateT
 
using complete_type = estd::decay_t< decltype(state_complete(std::declval< state_type >()))>
 

Public Member Functions

 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 ()&&
 
template<typename T >
void current (T &&x)
 
template<typename... InputTs2>
reductor_fn_baseoperator() (InputTs2 &&...ins)&
 Evaluates the next step of the reduction, passing the inputs ins to the reducing function. More...
 
template<typename... InputTs2>
reductor_fn_base operator() (InputTs2 &&...ins) const &
 
template<typename... InputTs2>
reductor_fn_base && operator() (InputTs2 &&...ins)&&
 

Protected Member Functions

template<typename ReducingFnT2 , typename StateT2 >
 reductor_fn_base (ReducingFnT2 &&step, StateT2 &&state)
 

Detailed Description

template<typename ReducingFnT, typename StateT, typename... InputTs>
struct atria::xform::reductor_fn_base< ReducingFnT, StateT, InputTs >

Common reductor interface.

This is an abstract type, use reductor_fn and empty_reductor_fn concrete types.

See also
reductor_fn
empty_reductor_fn

Definition at line 46 of file reductor.hpp.

Member Function Documentation

complete_type complete ( ) const
inline

Completes and returns the state of the reduction.

The operation os move aware.

Definition at line 65 of file reductor.hpp.

complete_type current ( ) const
inline

Peeks at the current visible state of the reduction.

The operation is move aware. If an argument is passed, it updates the current state.

Definition at line 75 of file reductor.hpp.

operator bool ( ) const
inlineexplicit

Returns whether the reductor_fn will produce more values.

Definition at line 58 of file reductor.hpp.

reductor_fn_base& operator() ( InputTs2 &&...  ins)
inline

Evaluates the next step of the reduction, passing the inputs ins to the reducing function.

Note
When operated on a const object, the it returns a new reductor_fn object. Otherwise, the operation is performed in-place and the object itself is returned. The operation is move-aware.

Definition at line 95 of file reductor.hpp.


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