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

Representation of a context pattern. Represents a context that uses a given policy to run a transformer. This pattern is intended to switch between execution policies in a pattern composition. More...

#include <context.h>

Public Types

using transformer_type = Transformer
 
using execution_policy_type = ExecutionPolicy
 

Public Member Functions

 context_t (ExecutionPolicy &e, Transformer &&t) noexcept
 Constructs a context with a execution policy and a transformer. More...
 
ExecutionPolicy & execution_policy ()
 Return the execution policy used in the context. More...
 
Transformer & transformer ()
 Return the transformer function. More...
 
template<typename I >
auto operator() (I &&item) const
 Invokes the trasnformer of the context over a data item. More...
 

Detailed Description

template<typename ExecutionPolicy, typename Transformer>
class grppi::context_t< ExecutionPolicy, Transformer >

Representation of a context pattern. Represents a context that uses a given policy to run a transformer. This pattern is intended to switch between execution policies in a pattern composition.

Template Parameters
ExecutionPolicyExecution policy type for the context.
TransformerCallable type for the context transformer.

Member Typedef Documentation

template<typename ExecutionPolicy , typename Transformer >
using grppi::context_t< ExecutionPolicy, Transformer >::execution_policy_type = ExecutionPolicy
template<typename ExecutionPolicy , typename Transformer >
using grppi::context_t< ExecutionPolicy, Transformer >::transformer_type = Transformer

Constructor & Destructor Documentation

template<typename ExecutionPolicy , typename Transformer >
grppi::context_t< ExecutionPolicy, Transformer >::context_t ( ExecutionPolicy &  e,
Transformer &&  t 
)
inlinenoexcept

Constructs a context with a execution policy and a transformer.

Parameters
eContext to run the transformer function.
tTransformer to be run.

Member Function Documentation

template<typename ExecutionPolicy , typename Transformer >
ExecutionPolicy& grppi::context_t< ExecutionPolicy, Transformer >::execution_policy ( )
inline

Return the execution policy used in the context.

Returns
The execution policy.
template<typename ExecutionPolicy , typename Transformer >
template<typename I >
auto grppi::context_t< ExecutionPolicy, Transformer >::operator() ( I &&  item) const
inline

Invokes the trasnformer of the context over a data item.

template<typename ExecutionPolicy , typename Transformer >
Transformer& grppi::context_t< ExecutionPolicy, Transformer >::transformer ( )
inline

Return the transformer function.

Returns
The transformer function.

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