#include <Queue.h>
Inheritance diagram for ZThread::Queue< T >:
Public Member Functions | |
virtual | ~Queue () |
Destroy a Queue. | |
virtual void | add (const T &item)=0 |
virtual bool | add (const T &item, unsigned long timeout)=0 |
virtual T | next ()=0 |
virtual T | next (unsigned long timeout)=0 |
virtual void | cancel ()=0 |
virtual size_t | size ()=0 |
virtual size_t | size (unsigned long timeout)=0 |
virtual bool | empty () |
virtual bool | empty (unsigned long timeout) |
virtual bool ZThread::Queue< T >::add | ( | const T & | item, | |
unsigned long | timeout | |||
) | [pure virtual] |
Add an object 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. |
Implemented in ZThread::BoundedQueue< T, LockType, StorageType >, ZThread::LockedQueue< T, LockType, StorageType >, and ZThread::MonitoredQueue< T, LockType, StorageType >.
virtual void ZThread::Queue< T >::add | ( | const T & | item | ) | [pure virtual] |
Add an object to this Queue.
item | value to be added to the Queue |
Cancellation_Exception | thrown if this Queue has been canceled. |
Implemented in ZThread::BlockingQueue< T, LockType, StorageType >, ZThread::BoundedQueue< T, LockType, StorageType >, ZThread::LockedQueue< T, LockType, StorageType >, and ZThread::MonitoredQueue< T, LockType, StorageType >.
virtual void ZThread::Queue< T >::cancel | ( | ) | [pure virtual] |
Canceling a Queue disables it, disallowing further additions. Values already present in the Queue can still be retrieved and are still available through the next() methods.
Canceling a Queue more than once has no effect.
Once emptied, the next() methods will throw a Cancellation_Exception.
The add() methods will throw a Cancellation_Exceptions from this point on.
Implements ZThread::Cancelable.
Implemented in ZThread::BlockingQueue< T, LockType, StorageType >, ZThread::BoundedQueue< T, LockType, StorageType >, ZThread::LockedQueue< T, LockType, StorageType >, and ZThread::MonitoredQueue< T, LockType, StorageType >.
virtual bool ZThread::Queue< T >::empty | ( | unsigned long | timeout | ) | [inline, virtual] |
Test whether any values are available in this 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 in ZThread::BoundedQueue< T, LockType, StorageType >, and ZThread::MonitoredQueue< T, LockType, StorageType >.
virtual bool ZThread::Queue< T >::empty | ( | ) | [inline, virtual] |
Test whether any values are available in this Queue.
Reimplemented in ZThread::BoundedQueue< T, LockType, StorageType >, and ZThread::MonitoredQueue< T, LockType, StorageType >.
virtual T ZThread::Queue< T >::next | ( | unsigned long | timeout | ) | [pure virtual] |
Retrieve and remove a value from this 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. |
Implemented in ZThread::BlockingQueue< T, LockType, StorageType >, ZThread::BoundedQueue< T, LockType, StorageType >, ZThread::LockedQueue< T, LockType, StorageType >, and ZThread::MonitoredQueue< T, LockType, StorageType >.
virtual T ZThread::Queue< T >::next | ( | ) | [pure virtual] |
Retrieve and remove a value from this Queue.
Cancellation_Exception | thrown if this Queue has been canceled. |
Implemented in ZThread::BlockingQueue< T, LockType, StorageType >, ZThread::BoundedQueue< T, LockType, StorageType >, ZThread::LockedQueue< T, LockType, StorageType >, and ZThread::MonitoredQueue< T, LockType, StorageType >.
virtual size_t ZThread::Queue< T >::size | ( | unsigned long | timeout | ) | [pure virtual] |
Count the values present in this 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 |
Implemented in ZThread::BlockingQueue< T, LockType, StorageType >, ZThread::BoundedQueue< T, LockType, StorageType >, ZThread::LockedQueue< T, LockType, StorageType >, and ZThread::MonitoredQueue< T, LockType, StorageType >.
virtual size_t ZThread::Queue< T >::size | ( | ) | [pure virtual] |
Count the values present in this Queue.
Implemented in ZThread::BlockingQueue< T, LockType, StorageType >, ZThread::BoundedQueue< T, LockType, StorageType >, ZThread::LockedQueue< T, LockType, StorageType >, and ZThread::MonitoredQueue< T, LockType, StorageType >.