BoundedQueue Class Template Reference
#include <BoundedQueue.h>
Inheritance diagram for BoundedQueue:
Public Member Functions | |
BoundedQueue (size_t capacity) | |
virtual | ~BoundedQueue () |
Destroy this Queue. | |
size_t | capacity () |
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 () |
Detailed Description
template<class T, class LockType, typename StorageType = std::deque<T>>
class ZThread::BoundedQueue< T, LockType, StorageType >
- Author:
- Eric Crahen <http://www.code-foo.com>
- Date:
- <2003-07-16T13:54:04-0400>
- Version:
- 2.3.0
- Threads calling the empty() methods will be blocked until the BoundedQueue becomes empty.
- Threads calling the next() methods will be blocked until the BoundedQueue has a value to return.
- Threads calling the add() methods will be blocked until the number of values in the Queue drops below the maximum capacity.
- See also:
- Queue
Constructor & Destructor Documentation
|
Create a BoundedQueue with the given capacity.
|
Member Function Documentation
|
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.
Implements Lockable. |
|
Add a value to this Queue. If the number of values in the queue matches the value returned by capacity() then the calling thread will be blocked until at least one value is removed from the Queue.
Implements Queue. |
|
Add a value to this Queue. If the number of values in the queue matches the value returned by capacity() then the calling thread will be blocked until at least one value is removed from the Queue.
Implements Queue. |
|
Cancel this queue.
Implements Queue. |
|
Get the maximum capacity of this Queue.
|
|
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 Queue. |
|
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 Queue. |
|
Implements Cancelable. |
|
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.
Implements Queue. |
|
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.
Implements Queue. |
|
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 Lockable. |
|
Implements Queue. |
|
Implements Queue. |
|
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.
Implements Lockable. |
The documentation for this class was generated from the following file:
- BoundedQueue.h