20 #ifndef __TPIE_PIPELINING_ORDERED_MERGE_H__
21 #define __TPIE_PIPELINING_ORDERED_MERGE_H__
23 #include <tpie/pipelining/pipe_base.h>
24 #include <tpie/pipelining/factory_helpers.h>
25 #include <tpie/pipelining/node.h>
37 template <
typename dest_t,
typename fact_t,
typename comp_t>
42 typename fact_t::constructed_type with;
46 comp(comp), with(fact.construct()), dest(std::move(dest)) {
51 void push(
const item_type & item) {
52 while (with.can_pull() && comp(with.peek(), item))
53 dest.push(with.pull());
58 while (with.can_pull())
59 dest.push(with.pull());
69 template <
typename fact_t,
typename comp_t=std::less<> >
70 inline pipe_middle<tfactory<bits::ordered_merge_t, Args<fact_t, comp_t>, fact_t, comp_t>>
72 return {std::move(fact), std::move(comp)};
77 #endif //__TPIE_PIPELINING_ORDERED_MERGE_H__