#include <receiver.h>
Inheritance diagram for utils::receiver::
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 |
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.
|
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. |
|
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!! |
|
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. |
|
|