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>
34 namespace pipelining {
46 set_name(
"Fetching items", PRIORITY_SIGNIFICANT);
51 m_queue = fetch<internal_queue<T> *>(
"queue");
54 bool can_pull()
const {
55 return !m_queue->empty();
59 T item=m_queue->front();
64 virtual void end()
override {
76 :
node(token), size(size) {
77 set_name(
"Storing items", PRIORITY_INSIGNIFICANT);
83 m_queue = tpie::tpie_new<internal_queue<item_type> >(size);
87 void push(
const T & item) {
104 template <
typename T>
131 , additional_item_size(additional_item_size) {}
133 input_t raw_input() {
134 return input_t(input_token, size);
137 output_t raw_output() {
138 return output_t(input_token, size);
146 return inputfact_t(input_token, size, additional_item_size);
159 size_t size, additional_item_size;
169 #endif // __TPIE_PIPELINING_INTERNAL_BUFFER_H__
Defines the tp_assert macro.
bool full() const
Check if the queue is empty.
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.
Generic internal queue with known memory requirements.
A generic internal circular queue.
void push(T val)
Add an element to the front of the queue.
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.
virtual void propagate() override
Propagate stream metadata.
void set_name(const std::string &name, priority_type priority=PRIORITY_USER)
Set this node's name.
void set_minimum_memory(memory_size_type minimumMemory)
Called by implementers to declare minimum memory requirements.
Node factory for variadic argument terminators.
inputpipe_t input()
Return pipe node where items are pushed into the buffer Pushing items into a full buffer causes undef...
void set_plot_options(flags< PLOT > options)
Set options specified for plot(), as a combination of node::PLOT values.
virtual void end() override
End pipeline processing phase.
void tpie_delete(T *p)
Delete an object allocated with tpie_new.
#define tp_assert(condition, message)
node()
Default constructor, using a new node_token.
internal_passive_buffer(size_t size, size_t additional_item_size=0)
Construct a factory for the buffer.