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>
30 namespace pipelining {
34 template <
typename dest_t>
37 typedef uint64_t count_t;
38 typedef typename dest_t::item_type::first_type item_type;
45 set_name(
"Count consecutive", PRIORITY_INSIGNIFICANT);
48 virtual void end()
override {
53 inline void push(
const item_type & item) {
54 if (current_count && item == item_buffer) {
64 if (!current_count)
return;
65 dest.push(std::make_pair(item_buffer, current_count));
69 item_type item_buffer;
70 count_t current_count;
78 inline any_type & operator=(
const T &) {
return *
this;}
81 template <
typename dest_t>
84 typedef std::pair<typename dest_t::item_type, any_type> item_type;
90 inline void push(
const item_type & item) {
91 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.
void set_name(const std::string &name, priority_type priority=PRIORITY_USER)
Set this node's name.
virtual void end()
End pipeline processing phase.
A pipe_middle class pushes input down the pipeline.
Simple class acting both as a tpie::file and a tpie::file::stream.
Node factory for 0-argument generator.