Go to the documentation of this file.
24 #ifndef __TPIE_PIPELINING_INTERNAL_BUFFER_H__
25 #define __TPIE_PIPELINING_INTERNAL_BUFFER_H__
27 #include <tpie/pipelining/node.h>
28 #include <tpie/pipelining/factory_helpers.h>
43 set_name(
"Fetching items", PRIORITY_SIGNIFICANT);
48 m_queue = fetch<internal_queue<T> *>(
"queue");
51 bool can_pull()
const {
52 return !m_queue->
empty();
56 T item=m_queue->
front();
73 :
node(token), size(size) {
74 set_name(
"Storing items", PRIORITY_INSIGNIFICANT);
80 m_queue = tpie::tpie_new<internal_queue<item_type> >(size);
84 void push(
const T & item) {
101 template <
typename T>
128 , additional_item_size(additional_item_size) {}
130 input_t raw_input() {
131 return input_t(input_token, size);
134 output_t raw_output() {
135 return output_t(input_token, size);
143 return inputfact_t(input_token, size, additional_item_size);
156 size_t size, additional_item_size;
164 #endif // __TPIE_PIPELINING_INTERNAL_BUFFER_H__
pipelining/factory_base.h Base class of pipelining factories
outputpipe_t output()
Return pipe node where items in the buffer can be pulled from Pulling from the empty buffer causes un...
void add_pull_source(const node_token &dest)
Called by implementers to declare a pull source.
const T & front() const
Return the item that has been in the queue for the longest time.
bool full() const
Check if the queue is empty.
A generic internal circular queue.
void push(T val)
Add an element to the front of the queue.
void set_minimum_memory(memory_size_type minimumMemory)
Called by implementers to declare minimum memory requirements.
void pop()
Remove an element from the back of the queue.
void set_plot_options(flags< PLOT > options)
Set options specified for plot(), as a combination of node::PLOT values.
void forward(std::string key, T value, memory_size_type k=std::numeric_limits< memory_size_type >::max())
Called by implementers to forward auxiliary data to successors.
#define tp_assert(condition, message)
void set_name(const std::string &name, priority_type priority=PRIORITY_USER)
Set this node's name.
inputpipe_t input()
Return pipe node where items are pushed into the buffer Pushing items into a full buffer causes undef...
void propagate() override
Propagate stream metadata.
bool empty() const
Check if the queue is empty.
void end() override
End pipeline processing phase.
void tpie_delete(T *p)
Delete an object allocated with tpie_new.
internal_passive_buffer(size_t size, size_t additional_item_size=0)
Construct a factory for the buffer.
node()
Default constructor, using a new node_token.