20 #ifndef __TPIE_PIPELINING_CHUNKER_H__
21 #define __TPIE_PIPELINING_CHUNKER_H__
23 #include <tpie/pipelining/node.h>
24 #include <tpie/pipelining/pipe_base.h>
25 #include <tpie/pipelining/factory_helpers.h>
26 #include <tpie/pipelining/node_name.h>
31 template <
typename dest_t>
35 typedef typename vector_type::value_type item_type;
43 , dest(std::move(dest))
46 set_name(
"Chunker", PRIORITY_INSIGNIFICANT);
55 items.reserve(maxSize);
58 void push(
const item_type & item) {
59 if (items.size() == maxSize) flush();
60 items.push_back(item);
64 if (!items.empty()) flush();
79 #endif //__TPIE_PIPELINING_CHUNKER_H__
pipelining/factory_base.h Base class of pipelining factories
void begin() override
Begin pipeline processing phase.
void free_structure_memory(T &v)
Free the memory assosiated with a stl or tpie structure by swapping it with a default constructed str...
void set_minimum_memory(memory_size_type minimumMemory)
Called by implementers to declare minimum memory requirements.
Class to deduce the item_type of a node of type T.
void set_name(const std::string &name, priority_type priority=PRIORITY_USER)
Set this node's name.
void end() override
End pipeline processing phase.
pipe_middle< factory< bits::chunker_t, size_t > > chunker
A pipelining node that gathers elements into a vector of some size.