20 #ifndef __TPIE_PIPELINING_UNIQ_H__
21 #define __TPIE_PIPELINING_UNIQ_H__
23 #include <tpie/pipelining/node.h>
24 #include <tpie/pipelining/pipe_base.h>
25 #include <tpie/pipelining/factory_helpers.h>
26 #include <tpie/file_stream.h>
30 namespace pipelining {
34 template <
typename dest_t>
37 typedef uint64_t count_t;
41 : dest(std::move(dest))
47 virtual void end()
override {
52 inline void push(
const item_type & item) {
53 if (current_count && item == item_buffer) {
63 if (!current_count)
return;
64 dest.push(std::make_pair(item_buffer, current_count));
68 item_type item_buffer;
69 count_t current_count;
77 inline any_type & operator=(
const T &) {
return *
this;}
80 template <
typename dest_t>
83 typedef std::pair<typename push_type<dest_t>::type,
any_type> item_type;
89 inline void push(
const item_type & item) {
90 dest.push(item.first);
virtual void end() override
End pipeline processing phase.
void add_push_destination(const node_token &dest)
Called by implementers to declare a push destination.
Class to deduce the item_type of a node of type T.
virtual void end()
End pipeline processing phase.
pipe_middle< bits::pair_factory< factory< bits::count_consecutive_t >, factory< bits::extract_first_t > > > pipeuniq()
A pipelining node that removes duplicate items and create a phase boundary.
Node factory for variadic argument generators.
A pipe_middle class pushes input down the pipeline.