#include <BlockingQueue.h>
Inheritance diagram for ZThread::BlockingQueue< T, LockType, StorageType >:
Public Member Functions | |
BlockingQueue () | |
Create a new BlockingQueue. | |
virtual | ~BlockingQueue () |
Destroy this BlockingQueue. | |
virtual void | add (const T &item) |
virtual bool | add (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 void | acquire () |
virtual bool | tryAcquire (unsigned long timeout) |
virtual void | release () |
virtual void ZThread::BlockingQueue< 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::BlockingQueue< T, LockType, StorageType >::add | ( | T | item, | |
unsigned long | timeout | |||
) | [inline, virtual] |
virtual void ZThread::BlockingQueue< T, LockType, StorageType >::add | ( | const T & | item | ) | [inline, virtual] |
virtual void ZThread::BlockingQueue< T, LockType, StorageType >::cancel | ( | ) | [inline, virtual] |
Implements ZThread::Queue< T >.
virtual bool ZThread::BlockingQueue< T, LockType, StorageType >::isCanceled | ( | ) | [inline, virtual] |
virtual T ZThread::BlockingQueue< T, LockType, StorageType >::next | ( | unsigned long | timeout | ) | [inline, virtual] |
Get a value from this Queue. The calling thread may block indefinitely.
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. | |
Interrupted_Exception | thrown if the calling thread is interrupted before a value becomes available. |
Implements ZThread::Queue< T >.
virtual T ZThread::BlockingQueue< T, LockType, StorageType >::next | ( | ) | [inline, virtual] |
Get a value from this Queue. The calling thread may block indefinitely.
Cancellation_Exception | thrown if this Queue has been canceled. | |
Interrupted_Exception | thrown if the calling thread is interrupted before a value becomes available. |
Implements ZThread::Queue< T >.
virtual void ZThread::BlockingQueue< 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::BlockingQueue< T, LockType, StorageType >::size | ( | unsigned long | timeout | ) | [inline, virtual] |
virtual size_t ZThread::BlockingQueue< T, LockType, StorageType >::size | ( | ) | [inline, virtual] |
virtual bool ZThread::BlockingQueue< 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.