GrPPI  0.3.1
Generic and Reusable Parallel Pattern Interface
Public Types | Public Member Functions | List of all members
grppi::farm_t< Transformer > Class Template Reference

Representation of farm pattern. Represents a farm of n replicas from a transformer. More...

#include <farm_pattern.h>

Public Types

using transformer_type = Transformer
 

Public Member Functions

 farm_t (int n, Transformer &&t) noexcept
 Constructs a farm with a cardinality and a transformer. More...
 
int cardinality () const noexcept
 Farm's cardinality or number of replicas. More...
 
Transformer & transformer ()
 Return the transformer function stored in the farm pattern. More...
 
template<typename I >
auto operator() (I &&item) const
 Invokes the trasnformer of the farm over a data item. More...
 

Detailed Description

template<typename Transformer>
class grppi::farm_t< Transformer >

Representation of farm pattern. Represents a farm of n replicas from a transformer.

Template Parameters
TransformerCallable type for the farm transformer.

Member Typedef Documentation

template<typename Transformer >
using grppi::farm_t< Transformer >::transformer_type = Transformer

Constructor & Destructor Documentation

template<typename Transformer >
grppi::farm_t< Transformer >::farm_t ( int  n,
Transformer &&  t 
)
inlinenoexcept

Constructs a farm with a cardinality and a transformer.

Parameters
nNumber of replicas for the farm.
tTransformer for the farm.

Member Function Documentation

template<typename Transformer >
int grppi::farm_t< Transformer >::cardinality ( ) const
inlinenoexcept

Farm's cardinality or number of replicas.

Returns
The farm's cardinality.
template<typename Transformer >
template<typename I >
auto grppi::farm_t< Transformer >::operator() ( I &&  item) const
inline

Invokes the trasnformer of the farm over a data item.

template<typename Transformer >
Transformer& grppi::farm_t< Transformer >::transformer ( )
inline

Return the transformer function stored in the farm pattern.

Returns
The transformer function.

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