Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

utils::receiver Class Template Reference

a multithreaded easy-to-use receiver class. More...

#include <receiver.h>

Inheritance diagram for utils::receiver::

boost::noncopyable List of all members.

Public Methods

 receiver ()
 creates a receiver object. More...

void shutdown ()
 shutdowns a receiver object. More...

void add (const T &v)
 adds an item to the receiver. More...


Friends

class Runner

Detailed Description

template<class T, class F, int TIMEOUT = 100>
class utils::receiver< T, F, TIMEOUT >

a multithreaded easy-to-use receiver class.

receiver classes can be used to implement object and/or message passing to worker threads. The class hides all thread creation details internally; when creating such a receiver object one simply has to pass a function object determining how to handle received objects.


Constructor & Destructor Documentation

template<class T, class F, int TIMEOUT>
utils::receiver< T, F, TIMEOUT >::receiver  
 

creates a receiver object.

The receiver object starts an own thread, which handles all received objects via the function class passed as F template parameter.


Member Function Documentation

template<class T, class F, int TIMEOUT>
void utils::receiver< T, F, TIMEOUT >::add const T &    v
 

adds an item to the receiver.

The item is stored internally and will be proceed somewhere in the near future.

This method must not be called from within the F function object!!

template<class T, class F, int TIMEOUT>
void utils::receiver< T, F, TIMEOUT >::shutdown  
 

shutdowns a receiver object.

The receiver object's thread loop is canceled, the thread is finished. Make sure you call this method before destroying the object.


Friends And Related Function Documentation

template<class T, class F, int TIMEOUT = 100>
friend class Runner [friend]
 


The documentation for this class was generated from the following file:
Generated on Mon Oct 22 17:03:48 2001 for rfc822 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001