util::stream::Thread Class Reference

#include <chain.hh>

List of all members.

Public Member Functions

template<class Position , class Worker >
 Thread (const Position &position, const Worker &worker)
 ~Thread ()
template<class Position , class Worker >
void operator() (const Position &position, Worker &worker)


Detailed Description

Encapsulates a worker thread processing data at a given position in the chain.

Each instance of this class owns one boost thread in which the worker is Run().

Definition at line 56 of file chain.hh.


Constructor & Destructor Documentation

template<class Position , class Worker >
util::stream::Thread::Thread ( const Position &  position,
const Worker worker 
) [inline]

Constructs a new Thread in which the provided Worker is Run().

Position is usually ChainPosition but if there are multiple streams involved, this can be ChainPositions.

After a call to this constructor, the provided worker will be running within a boost thread owned by the newly constructed Thread object.

Definition at line 66 of file chain.hh.

util::stream::Thread::~Thread (  ) 

Definition at line 19 of file chain.cc.


Member Function Documentation

template<class Position , class Worker >
void util::stream::Thread::operator() ( const Position &  position,
Worker worker 
) [inline]

Launches the provided worker in this object's boost thread.

This method is called automatically by this class's constructor.

Definition at line 76 of file chain.hh.


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

Generated on Thu Jul 6 00:34:53 2017 for Moses by  doxygen 1.5.9