21 #ifndef GRPPI_POLY_STREAM_ITERATOR_H 22 #define GRPPI_POLY_STREAM_ITERATOR_H 25 #include "../common/support.h" 29 template<
typename Generator,
typename Predicate,
typename Consumer,
30 typename Transformer >
36 template <
typename E,
typename ... O,
37 typename Generator,
typename Predicate,
typename Consumer,
38 typename Transformer ,
45 std::forward<Consumer>(out));
48 template <
class E,
typename ... O,
49 typename Generator,
typename Predicate,
typename Consumer,
50 typename Transformer ,
55 if (
typeid(E) == e.
type() &&
typeid(E) == op.exectype.type()) {
56 auto & pipe_exec = op.exectype;
57 auto & actual_exec = *pipe_exec.
template execution_ptr<E>();
58 auto transformed_farm =
farm(actual_exec, std::forward<Transformer>(op.task));
60 std::forward<Generator>(in),
62 std::forward<Consumer>(out));
67 std::forward<Consumer>(out));
71 template<
typename Generator,
typename Predicate,
typename Consumer,
72 typename ...MoreTransformers >
78 template <
typename E,
typename ... O,
79 typename Generator,
typename Predicate,
typename Consumer,
80 typename ...MoreTransformers ,
81 internal::requires_execution_not_supported<E> = 0>
87 std::forward<Consumer>(out));
90 template <
class E,
typename ... O,
91 typename Generator,
typename Predicate,
typename Consumer,
92 typename ...MoreTransformers ,
93 internal::requires_execution_supported<E> = 0>
97 if (
typeid(E) == e.
type() &&
typeid(E) == op.exectype.type()) {
98 auto & pipe_exec = op.exectype;
99 auto & actual_exec = *pipe_exec.
template execution_ptr<E>();
100 auto transformed_pipe =
transform_pipeline(actual_exec, std::forward<std::tuple<MoreTransformers...>>(op.stages));
102 std::forward<Generator>(in),
104 std::forward<Consumer>(out));
109 std::forward<Consumer>(out));
113 template<
typename Generator,
typename Predicate,
typename Consumer,
116 Operation && op, Predicate && predicate_op, Consumer && out)
120 template <
typename E,
typename ... O,
121 typename Generator,
typename Predicate,
typename Consumer,
123 internal::requires_execution_not_supported<E> = 0>
125 Operation && op, Predicate && predicate_op, Consumer && out)
128 std::forward<Operation>(op), std::forward<Predicate>(predicate_op),
129 std::forward<Consumer>(out));
132 template <
typename E,
typename ... O,
133 typename Generator,
typename Predicate,
typename Consumer,
135 internal::requires_execution_supported<E> = 0>
137 Operation && op, Predicate && predicate_op, Consumer && out)
139 if (
typeid(E) == e.
type()) {
141 std::forward<Generator>(in),
142 std::forward<Operation>(op), std::forward<Predicate>(predicate_op),
143 std::forward<Consumer>(out));
147 std::forward<Operation>(op), std::forward<Predicate>(predicate_op),
148 std::forward<Consumer>(out));
174 template <
typename Generator,
typename Predicate,
typename Consumer,
175 typename Transformer>
177 Generator && generate_op,
179 Predicate && predicate_op, Consumer && consume_op)
184 >(ex, std::forward<Generator>(generate_op),
186 std::forward<Predicate>(predicate_op),
187 std::forward<Consumer>(consume_op));
203 template <
typename Generator,
typename Predicate,
typename Consumer,
204 typename ... Transformers>
207 Predicate && predicate_op, Consumer && consume_op)
212 >(ex, std::forward<Generator>(generate_op),
214 std::forward<Predicate>(predicate_op),
215 std::forward<Consumer>(consume_op));
231 template <
typename Generator,
typename Transformer,
typename Predicate,
typename Consumer>
233 Generator && generate_op,
234 Transformer && transform_op, Predicate && predicate_op,
235 Consumer && consume_op)
240 >(ex, std::forward<Generator>(generate_op), std::forward<Transformer>(transform_op),
241 std::forward<Predicate>(predicate_op), std::forward<Consumer>(consume_op));
Definition: callable_traits.h:24
void repeat_until_multi_impl(polymorphic_execution &e, Generator &&in, farm_info< polymorphic_execution, Transformer > &&op, Predicate &&predicate_op, Consumer &&out)
Definition: poly/stream_iteration.h:31
Definition: patterns.h:29
void repeat_until(parallel_execution_native &ex, Generator &&generate_op, pipeline_info< parallel_execution_native, MoreTransformers... > &&pipe, Predicate predicate_op, Consumer consume_op)
Invoke Stream iteration pattern on a data stream with native parallel execution with a generator...
Definition: native/stream_iteration.h:55
pipeline_info< Execution, Transformer, MoreTransformers... > transform_pipeline(Execution &ex, std::tuple< Transformer, MoreTransformers... > &&transform_ops)
Definition: poly/pipeline.h:33
Native parallel execution policy. This policy uses ISO C++ threads as implementation building block a...
Definition: parallel_execution_native.h:136
const std::type_info & type() const noexcept
Definition: polymorphic_execution.h:77
std::enable_if_t< is_supported< E >(), int > requires_execution_supported
Definition: support.h:32
E * execution_ptr()
Get the execution pointer for a given type.
Definition: polymorphic_execution.h:91
Definition: patterns.h:51
Sequential execution policy.
Definition: sequential_execution.h:31
Definition: polymorphic_execution.h:63
auto farm(Execution &ex, Transformer &&transform_op)
Invoke Farm pattern on a data stream that can be composed in other streaming patterns.
Definition: farm.h:51
std::enable_if_t<!is_supported< E >(), int > requires_execution_not_supported
Definition: support.h:36