snark
Public Member Functions | List of all members
bursty_reader< T > Class Template Reference

#include <bursty_reader.h>

Public Member Functions

 bursty_reader (boost::function0< T > read, unsigned int size=0)
 bursty_reader (boost::function0< T > read, unsigned int size, unsigned int capacity)
void join ()
 join the push thread
void stop ()
bool wait ()
 ~bursty_reader ()
 desctructor

Detailed Description

template<typename T>
class snark::tbb::bursty_reader< T >

helper class to run a tbb pipeline with bursty data the pipeline has to be closed when no data is received to prevent the main thread to spin

Constructor & Destructor Documentation

bursty_reader ( boost::function0< T >  read,
unsigned int  size = 0 
)

constructor

Parameters
readthe user-provided read functor that outputs the data
sizemaximum input queue size before discarding data, 0 means infinite
bursty_reader ( boost::function0< T >  read,
unsigned int  size,
unsigned int  capacity 
)

constructor

Parameters
readthe user-provided read functor that outputs the data
sizemaximum input queue size before discarding data, 0 means infinite
capacitymaximum input queue size before the reader thread blocks

Member Function Documentation

void stop ( )

stop pushing items in the queue, will not wait until the thread actually exits, call join() if this is what you want

Referenced by pipeline::write_().

bool wait ( )

wait until the queue is ready

Returns
true if the reader is running or the queue is not empty, ie. if the pipeline should be started

Referenced by bursty_pipeline< T >::run().


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