generic template class for a thread with one outbound queue and multiple inbound queues More...
#include <TwoWayThreadModule.h>
Public Member Functions | |
bool | emptyIn () |
InT | popIn () |
OutT | popOut () |
void | pushIn (InT element) |
void | pushOut (OutT element, size_t queueId) |
int | sizeIn () |
int | sizeOut () |
TwoWayThreadModule (size_t numInQueues) | |
The constructor. By default, one ingoing and one outgoing queue is created. | |
virtual | ~TwoWayThreadModule () |
generic template class for a thread with one outbound queue and multiple inbound queues
Every thread of execution in an application is created by instantiating an object of a class derived from the Thread class. These classes must implement the run() method, which specifies the code of the thread. The type of the messages is set when using the template. Example:
Definition at line 39 of file TwoWayThreadModule.h.
TwoWayThreadModule< OutT, InT >::TwoWayThreadModule | ( | size_t | numInQueues | ) | [inline] |
The constructor. By default, one ingoing and one outgoing queue is created.
Definition at line 48 of file TwoWayThreadModule.h.
virtual TwoWayThreadModule< OutT, InT >::~TwoWayThreadModule | ( | ) | [inline, virtual] |
Definition at line 53 of file TwoWayThreadModule.h.
bool TwoWayThreadModule< OutT, InT >::emptyIn | ( | ) | [inline] |
Definition at line 108 of file TwoWayThreadModule.h.
InT TwoWayThreadModule< OutT, InT >::popIn | ( | ) | [inline] |
This method returns the first element of the inbound queue. If no element is present, it blocks until a new is available. This behaviour is implemented in the class ThreadQueue.
Definition at line 100 of file TwoWayThreadModule.h.
OutT TwoWayThreadModule< OutT, InT >::popOut | ( | ) | [inline] |
This method returns the first element of the outbound queue. If no element is present, it blocks until a new is available. This behaviour is implemented in the class ThreadQueue.
Definition at line 71 of file TwoWayThreadModule.h.
void TwoWayThreadModule< OutT, InT >::pushIn | ( | InT | element | ) | [inline] |
Pushs an element in the inbound queue. The signaling of a waiting thread is done in the class ThreadQueue and not here.
element | the item which will be put in front of the inbound queue |
Definition at line 90 of file TwoWayThreadModule.h.
void TwoWayThreadModule< OutT, InT >::pushOut | ( | OutT | element, |
size_t | queueId | ||
) | [inline] |
Pushs an element in the outbound queue. The signaling of a waiting thread is done in the class ThreadQueue and not here.
element | the item which will be put in front of the outbound queue |
Definition at line 61 of file TwoWayThreadModule.h.
int TwoWayThreadModule< OutT, InT >::sizeIn | ( | ) | [inline] |
Definition at line 116 of file TwoWayThreadModule.h.
int TwoWayThreadModule< OutT, InT >::sizeOut | ( | ) | [inline] |
Definition at line 79 of file TwoWayThreadModule.h.