#include <chain.hh>
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) |
Each instance of this class owns one boost thread in which the worker is Run().
Definition at line 56 of file chain.hh.
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.
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.