#include <BufferedQueue.h>
Inheritance diagram for ZThread::BufferedQueue::
Public Methods | |
BufferedQueue (unsigned int capacity) | |
virtual | ~BufferedQueue () throw () |
unsigned int | capacity () |
virtual void | add (T item) throw (Synchronization_Exception) |
virtual T | next () throw (Synchronization_Exception) |
virtual T | next (unsigned long timeout) throw (Synchronization_Exception) |
virtual void | cancel () throw (Synchronization_Exception) |
virtual bool | isCanceled () throw (Synchronization_Exception) |
virtual bool | empty () throw (Synchronization_Exception) |
Protected Attributes | |
LOCK | _lock |
Serialize access. | |
Condition | _notFull |
Signaled if not full. | |
Condition | _notEmpty |
Signaled if not empty. | |
Condition | _isEmpty |
Signaled if empty. | |
std::deque<T> | _queue |
Backing deque. | |
bool | _canceled |
Cancellation flag. |
|
Create a new queue with the given capacity. This capacity can not be altered once the queue is created
|
|
Destroy this Queue |
|
Insert a new item into the queue. The calling thread will be blocked if the queue has reached its capacity. Execution of that thread will continue after items are removed and the queue is not filled to capacity any longer. One thread blocked by a next() request will be woken up. This implementation signals a condition variable used to block threads waiting for items to be added to the queue
Reimplemented from ZThread::Queue. |
|
Cancel this queue, no more additions will be accepted.
Reimplemented from ZThread::Queue. |
|
Get the capacity of this queue.
|
|
Test the queue to determine if it has been emptied. The calling thread is blocked until the queue empties A Queue can reach empty many times during its lifetime it is not a one time occurrence. However, after a queue has been canceled it will reach empty only once more
Reimplemented from ZThread::Queue. |
|
Check the cancelation status of this Queue
Reimplemented from ZThread::Cancelable. |
|
Take an item from the queue, block if empty. If the given time expires
Reimplemented from ZThread::Queue. |
|
Take an item from the queue, block if empty. If the given time expires
Reimplemented from ZThread::Queue. |