QueueHolder< DataType_t > Class Template Reference

The class containing the queue and all related elements. More...

Inheritance diagram for QueueHolder< DataType_t >:

Public Types

typedef DataType_t DataType
 The type of data being exchanged.

Public Member Functions

 QueueHolder (unsigned int queueSize, DataUploader< DataType > *u)
 Constructor.
 ~QueueHolder ()
 Destructor.
- Public Member Functions inherited from QueueHolderBase
 QueueHolderBase ()
 Constructor.

Public Attributes

unsigned int availableSpace
 The number of data the queue can hold before becoming full.
DataTypecurrentDownloaderDatum
 The datum the downloader is currently using.
DataDownloader< DataType > * downloader
 The downloader associated with this queue.
QLinkedList< DataType * >::iterator nextDownloadIt
 The position in the queue that will be read next by the downloader.
DataTypenextUploaderDatum
 The next datum the uploader will use.
QLinkedList< DataType * >::iterator nextUploadIt
 The iterator to the element of the queue where the \ next datum uploaded by the uploader will be put.
unsigned int numDataInQueue
 The number of data currently in the queue.
QLinkedList< DataType * > queue
 The queue of data.
bool queueFullLastDatumCreation
 Whether the queue was full the last time a datum was created.
DataUploader< DataType > * uploader
 The uploader associated with this queue.
- Public Attributes inherited from QueueHolderBase
bool dataExchangeStopped
 If true no data exchange is possible.
QMutex mutex
 The mutex protecting from concurrent accesses to data in this object.
QWaitCondition waitCondition
 The wait condition used to wake the blocked downloader when a new datum arrives or the uploader when the queue is full.

Detailed Description

template<class DataType_t>
class farsa::__DataExchange_internal::QueueHolder< DataType_t >

The class containing the queue and all related elements.

This also contains the lock to use when accessing the queue

Definition at line 1149 of file dataexchange.h.

Member Typedef Documentation

typedef DataType_t DataType

The type of data being exchanged.

Definition at line 1155 of file dataexchange.h.

Constructor & Destructor Documentation

QueueHolder ( unsigned int  queueSize,
DataUploader< DataType > *  u 
)
inline

Constructor.

This creates the queue ad allocates all objects used here

Parameters
queueSizethe initial size of the queue
uthe uploader associated with this queue

Definition at line 1165 of file dataexchange.h.

~QueueHolder ( )
inline

Destructor.

This deallocates all memory

Definition at line 1214 of file dataexchange.h.

Member Data Documentation

unsigned int availableSpace

The number of data the queue can hold before becoming full.

Definition at line 1238 of file dataexchange.h.

DataType* currentDownloaderDatum

The datum the downloader is currently using.

This will go back in the queue once the downloader asks for a new datum

Definition at line 1267 of file dataexchange.h.

Referenced by QueueHolder< DataType >::QueueHolder(), and QueueHolder< DataType >::~QueueHolder().

DataDownloader<DataType>* downloader

The downloader associated with this queue.

Definition at line 1289 of file dataexchange.h.

QLinkedList<DataType*>::iterator nextDownloadIt

The position in the queue that will be read next by the downloader.

Definition at line 1279 of file dataexchange.h.

Referenced by QueueHolder< DataType >::QueueHolder().

DataType* nextUploaderDatum

The next datum the uploader will use.

This will go in the queue once uploading has ended and will be replaced by an element of the queue. If however the uploader FullQueueBehavior is IncreaseQueueSize, a new object could be created

Definition at line 1259 of file dataexchange.h.

Referenced by QueueHolder< DataType >::QueueHolder(), and QueueHolder< DataType >::~QueueHolder().

QLinkedList<DataType*>::iterator nextUploadIt

The iterator to the element of the queue where the \ next datum uploaded by the uploader will be put.

Definition at line 1273 of file dataexchange.h.

Referenced by QueueHolder< DataType >::QueueHolder().

unsigned int numDataInQueue

The number of data currently in the queue.

Definition at line 1243 of file dataexchange.h.

QLinkedList<DataType*> queue

The queue of data.

Definition at line 1232 of file dataexchange.h.

Referenced by QueueHolder< DataType >::QueueHolder(), and QueueHolder< DataType >::~QueueHolder().

bool queueFullLastDatumCreation

Whether the queue was full the last time a datum was created.

Definition at line 1249 of file dataexchange.h.

DataUploader<DataType>* uploader

The uploader associated with this queue.

Definition at line 1284 of file dataexchange.h.


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