Public Member Functions
TwoWayThreadModule< OutT, InT > Class Template Reference

generic template class for a thread with one outbound queue and multiple inbound queues More...

#include <TwoWayThreadModule.h>

Inheritance diagram for TwoWayThreadModule< OutT, InT >:
Inheritance graph
[legend]

List of all members.

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 ()

Detailed Description

template<class OutT, class InT>
class TwoWayThreadModule< OutT, InT >

generic template class for a thread with one outbound queue and multiple inbound queues

Author:
Johannes Pellenz, David Gossow (RX) Encapsulates the platform-specific details of a thread with an outbound and an inbound queue. Such a thread is the basis for a dockable module which is able to communicate with another instance by exchanging messages which are pushed in the queues and can be of any type. The outbound queue has the purpose to transport messages from the module to the controlling instance (e.g. dispatcher) while the inbound queue transports messages in the reverse direction.

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.


Constructor & Destructor Documentation

template<class OutT , class InT >
TwoWayThreadModule< OutT, InT >::TwoWayThreadModule ( size_t  numInQueues) [inline]

The constructor. By default, one ingoing and one outgoing queue is created.

Note:
sets his own condition object as the one for the inbound queue.

Definition at line 48 of file TwoWayThreadModule.h.

template<class OutT , class InT >
virtual TwoWayThreadModule< OutT, InT >::~TwoWayThreadModule ( ) [inline, virtual]

Definition at line 53 of file TwoWayThreadModule.h.


Member Function Documentation

template<class OutT , class InT >
bool TwoWayThreadModule< OutT, InT >::emptyIn ( ) [inline]
Returns:
true, if the inbound queue contains no elements

Definition at line 108 of file TwoWayThreadModule.h.

template<class OutT , class InT >
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.

Returns:
the first element of the inbound queue

Definition at line 100 of file TwoWayThreadModule.h.

template<class OutT , class InT >
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.

Returns:
the first element of the outbound queue

Definition at line 71 of file TwoWayThreadModule.h.

template<class OutT , class InT >
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.

Parameters:
elementthe item which will be put in front of the inbound queue

Definition at line 90 of file TwoWayThreadModule.h.

template<class OutT , class InT >
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.

Parameters:
elementthe item which will be put in front of the outbound queue

Definition at line 61 of file TwoWayThreadModule.h.

template<class OutT , class InT >
int TwoWayThreadModule< OutT, InT >::sizeIn ( ) [inline]
Returns:
the current number of elements in the inbound queue

Definition at line 116 of file TwoWayThreadModule.h.

template<class OutT , class InT >
int TwoWayThreadModule< OutT, InT >::sizeOut ( ) [inline]
Returns:
the current number of elements in the outbound queue

Definition at line 79 of file TwoWayThreadModule.h.


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


robbie_architecture
Author(s): Viktor Seib
autogenerated on Mon Oct 6 2014 02:53:09