20 #ifndef __TPIE_PIPELINING_PIPE_BASE_H__
21 #define __TPIE_PIPELINING_PIPE_BASE_H__
23 #include <tpie/tpie_export.h>
25 #include <tpie/pipelining/priority_type.h>
26 #include <tpie/pipelining/pair_factory.h>
27 #include <tpie/pipelining/pipeline.h>
28 #include <tpie/pipelining/node_set.h>
38 #pragma warning(disable: 4521)
44 template <
typename child_t>
65 return std::move(
self());
90 child_t
name(
const std::string & n, priority_type p = PRIORITY_USER) {
92 return std::move(
self());
102 child_t
phase_name(
const std::string & n, priority_type p = PRIORITY_USER) {
104 return std::move(
self());
117 return std::move(
self());
126 self().
factory.add_dependencies(s);
127 return std::move(
self());
136 self().
factory.add_forwarding_dependencies(s);
137 return std::move(
self());
149 return std::move(
self());
153 self().
factory.forward(key, std::move(value));
154 return std::move(
self());
157 template <
typename T>
158 child_t forward(
const std::string & key, T value) {
163 child_t &
self() {
return *
static_cast<child_t*
>(
this);}
164 const child_t &
self()
const {
return *
static_cast<const child_t*
>(
this);}
172 template <
typename child_t,
typename fact_t>
175 typedef typename fact_t::constructed_type constructed_type;
177 constructed_type construct() {
178 return this->
self().
factory.construct();
185 template <
typename child_t>
194 template <
typename dest_t>
197 using type =
typename child_t::factory_type::template constructed_type<dest_t>;
200 template <
typename dest_t>
201 using constructed_type =
typename constructed<dest_t>::type;
203 template <
typename dest_t>
204 constructed_type<dest_t> construct(
const dest_t & dest) {
205 return this->
self().
factory.construct(dest);
211 template <
typename fact_t>
214 typedef fact_t factory_type;
225 template <
typename ... T_ARGS>
232 class empty_pipe_middle;
242 template <
typename fact_t>
245 typedef fact_t factory_type;
270 template <
typename ... T_ARGS>
276 template <
typename fact2_t>
292 template <
typename fact2_t>
318 template <
typename fact_t>
325 template <
typename fact_t>
330 template <
typename fact_t>
340 typedef fact_t factory_type;
358 template <
typename ... T_ARGS>
362 template <
typename fact2_t>
369 pipe_begin operator|(empty_pipe_middle &&) {
return pipe_begin(std::move(factory));}
371 template <
typename fact2_t>
372 bits::pipeline_impl<bits::termpair_factory<fact_t, fact2_t> >
373 operator|(pipe_end<fact2_t> && r) {
374 factory.set_destination_kind_push();
375 return bits::termpair_factory<fact_t, fact2_t>(std::move(factory), std::move(r.factory)).finalize();
381 template <
typename fact_t>
384 typedef fact_t factory_type;
397 template <
typename ... T_ARGS>
403 template <
typename fact_t>
406 typedef fact_t factory_type;
419 template <
typename ... T_ARGS>
422 template <
typename fact2_t>
425 fact2_t f = std::move(r.factory);
426 f.set_destination_kind_pull();
430 template <
typename fact2_t>
431 pullpipe_end<bits::termpair_factory<fact2_t, fact_t> >
432 operator|(pipe_end<fact2_t> && r) {
433 fact2_t f = std::move(r.factory);
434 f.set_destination_kind_pull();
435 return bits::termpair_factory<fact2_t, fact_t>(std::move(f), std::move(factory));
441 template <
typename fact_t>
444 typedef fact_t factory_type;
457 template <
typename ... T_ARGS>
460 template <
typename fact2_t>
463 fact2_t f = std::move(r.factory);
464 f.set_destination_kind_pull();
468 template <
typename fact2_t>
469 bits::pipeline_impl<bits::termpair_factory<fact2_t, fact_t> >
470 operator|(pullpipe_end<fact2_t> && r) {
471 fact2_t f = std::move(r.factory);
472 f.set_destination_kind_pull();
473 return bits::termpair_factory<fact2_t, fact_t>(std::move(f), std::move(factory)).finalize();
485 #endif // __TPIE_PIPELINING_PIPE_BASE_H__