#include <MonitoredQueue.h>
Inheritance diagram for ZThread::MonitoredQueue< T, LockType, StorageType >:
Public Member Functions | |
MonitoredQueue () | |
Create a new MonitoredQueue. | |
virtual | ~MonitoredQueue () |
Destroy a MonitoredQueue, delete remaining items. | |
virtual void | add (const T &item) |
virtual bool | add (const T &item, unsigned long timeout) |
virtual T | next () |
virtual T | next (unsigned long timeout) |
virtual void | cancel () |
virtual bool | isCanceled () |
virtual size_t | size () |
virtual size_t | size (unsigned long timeout) |
virtual bool | empty () |
virtual bool | empty (unsigned long timeout) |
virtual void | acquire () |
virtual bool | tryAcquire (unsigned long timeout) |
virtual void | release () |
virtual void ZThread::MonitoredQueue< T, LockType, StorageType >::acquire | ( | ) | [inline, virtual] |
Acquire the Lockable object.
This method may or may not block the caller for an indefinite amount of time. Those details are defined by specializations of this class.
Interrupted_Exception | thrown if the calling thread is interrupted before the operation completes. |
Implements ZThread::Lockable.
virtual bool ZThread::MonitoredQueue< T, LockType, StorageType >::add | ( | const T & | item, | |
unsigned long | timeout | |||
) | [inline, virtual] |
Add a value to this Queue.
item | value to be added to the Queue | |
timeout | maximum amount of time (milliseconds) this method may block the calling thread. |
Cancellation_Exception | thrown if this Queue has been canceled. | |
Interrupted_Exception | thrown if the thread was interrupted while waiting to add a value |
Implements ZThread::Queue< T >.
virtual void ZThread::MonitoredQueue< T, LockType, StorageType >::add | ( | const T & | item | ) | [inline, virtual] |
Add a value to this Queue.
item | value to be added to the Queue |
Cancellation_Exception | thrown if this Queue has been canceled. | |
Interrupted_Exception | thrown if the thread was interrupted while waiting to add a value |
Implements ZThread::Queue< T >.
virtual void ZThread::MonitoredQueue< T, LockType, StorageType >::cancel | ( | ) | [inline, virtual] |
Cancel this queue.
Implements ZThread::Queue< T >.
virtual bool ZThread::MonitoredQueue< T, LockType, StorageType >::empty | ( | unsigned long | timeout | ) | [inline, virtual] |
Test whether any values are available in this Queue.
The calling thread is blocked until there are no values present in the Queue.
timeout | maximum amount of time (milliseconds) this method may block the calling thread. |
Timeout_Exception | thrown if timeout milliseconds expire before a value becomes available |
Reimplemented from ZThread::Queue< T >.
virtual bool ZThread::MonitoredQueue< T, LockType, StorageType >::empty | ( | ) | [inline, virtual] |
Test whether any values are available in this Queue.
The calling thread is blocked until there are no values present in the Queue.
Reimplemented from ZThread::Queue< T >.
virtual bool ZThread::MonitoredQueue< T, LockType, StorageType >::isCanceled | ( | ) | [inline, virtual] |
virtual T ZThread::MonitoredQueue< T, LockType, StorageType >::next | ( | unsigned long | timeout | ) | [inline, virtual] |
Retrieve and remove a value from this Queue.
If invoked when there are no values present to return then the calling thread will be blocked until a value arrives in the Queue.
timeout | maximum amount of time (milliseconds) this method may block the calling thread. |
Cancellation_Exception | thrown if this Queue has been canceled. | |
Timeout_Exception | thrown if the timeout expires before a value can be retrieved. |
Implements ZThread::Queue< T >.
virtual T ZThread::MonitoredQueue< T, LockType, StorageType >::next | ( | ) | [inline, virtual] |
Retrieve and remove a value from this Queue.
If invoked when there are no values present to return then the calling thread will be blocked until a value arrives in the Queue.
Cancellation_Exception | thrown if this Queue has been canceled. | |
Interrupted_Exception | thrown if the thread was interrupted while waiting to retrieve a value |
Implements ZThread::Queue< T >.
virtual void ZThread::MonitoredQueue< T, LockType, StorageType >::release | ( | ) | [inline, virtual] |
Release the Lockable object.
This method may or may not block the caller for an indefinite amount of time. Those details are defined by specializations of this class.
Implements ZThread::Lockable.
virtual size_t ZThread::MonitoredQueue< T, LockType, StorageType >::size | ( | unsigned long | timeout | ) | [inline, virtual] |
virtual size_t ZThread::MonitoredQueue< T, LockType, StorageType >::size | ( | ) | [inline, virtual] |
virtual bool ZThread::MonitoredQueue< T, LockType, StorageType >::tryAcquire | ( | unsigned long | timeout | ) | [inline, virtual] |
Attempt to acquire the Lockable object.
This method may or may not block the caller for a definite amount of time. Those details are defined by specializations of this class; however, this method includes a timeout value that can be used to limit the maximum amount of time that a specialization could block.
timeout | - maximum amount of time (milliseconds) this method could block |
Interrupted_Exception | thrown if the calling thread is interrupted before the operation completes. |
Implements ZThread::Lockable.