TPIE

11a2c2d
tpie::pipelining::parallel_bits::after< T > Class Template Reference

Accepts output items and sends them to the main thread. More...

#include <tpie/pipelining/parallel/base.h>

Public Types

typedef T item_type
 

Public Member Functions

template<typename Input >
 after (state< Input, T > &state, size_t parId)
 
void set_consumer (node *cons) override
 
 after (after &&other)
 
void push (const T &item)
 Push to thread-local buffer; flush it when full. More...
 
void end () override
 
void worker_initialize () override
 Invoked by before::worker (in worker thread context). More...
 
void flush_buffer () override
 Invoked by before::push_all when all input items have been pushed. More...
 

Protected Types

typedef state_base::lock_t lock_t
 

Protected Attributes

state_basest
 
size_t parId
 
std::unique_ptr< parallel_output_buffer< T > > m_buffer
 
array< parallel_output_buffer< T > * > & m_outputBuffers
 
consumer< T > *const * m_cons
 

Detailed Description

template<typename T>
class tpie::pipelining::parallel_bits::after< T >

Accepts output items and sends them to the main thread.

Definition at line 41 of file base.h.

Member Function Documentation

◆ flush_buffer()

template<typename T >
void tpie::pipelining::parallel_bits::after< T >::flush_buffer ( )
inlineoverride

Invoked by before::push_all when all input items have been pushed.

Definition at line 490 of file base.h.

490  {
491  flush_buffer_impl(true);
492  }

◆ push()

template<typename T >
void tpie::pipelining::parallel_bits::after< T >::push ( const T &  item)
inline

Push to thread-local buffer; flush it when full.

Definition at line 466 of file base.h.

466  {
467  if (m_buffer->m_outputSize >= m_buffer->m_outputBuffer.size())
468  flush_buffer_impl(false);
469 
470  m_buffer->m_outputBuffer[m_buffer->m_outputSize++] = item;
471  }

◆ worker_initialize()

template<typename T >
void tpie::pipelining::parallel_bits::after< T >::worker_initialize ( )
inlineoverride

Invoked by before::worker (in worker thread context).

Definition at line 481 of file base.h.

481  {
482  m_buffer.reset(new parallel_output_buffer<T>(st.opts));
483  m_outputBuffers[parId] = m_buffer.get();
484  }

The documentation for this class was generated from the following file: