GrPPI  0.3.1
Generic and Reusable Parallel Pattern Interface
pipeline.h
Go to the documentation of this file.
1 
21 #ifndef GRPPI_PIPELINE_H
22 #define GRPPI_PIPELINE_H
23 
24 #include <utility>
25 
26 #include "common/callable_traits.h"
29 
30 namespace grppi {
31 
49 template <typename Execution, typename Generator, typename ... Transformers,
50  requires_execution_supported<Execution> = 0>
51 void pipeline(
52  const Execution & ex,
53  Generator && generate_op,
54  Transformers && ... transform_ops)
55 {
56  static_assert(supports_pipeline<Execution>(),
57  "pipeline pattern is not supported by execution type");
58  ex.pipeline(std::forward<Generator>(generate_op),
59  std::forward<Transformers>(transform_ops)...);
60 }
61 
72 template <typename Generator, typename ... Transformers, typename Consumer>
73 auto pipeline(
74  Generator && generate_op,
75  Transformers && ... transform_ops,
76  Consumer && consume_op)
77 {
78  return pipeline_t<Generator,Transformers...,Consumer> (
79  std::forward<Generator>(generate_op),
80  std::forward<Transformers>(transform_ops)...,
81  std::forward<Consumer>(consume_op));
82 }
88 }
89 
90 #endif
Definition: callable_traits.h:26
void pipeline(const Execution &ex, Generator &&generate_op, Transformers &&...transform_ops)
Invoke Pipeline pattern on a data stream.
Definition: pipeline.h:51
Representation of pipeline pattern. Represents a pipeline with multiple chained transformers.
Definition: pipeline_pattern.h:34