#include <Queue.h>

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 | ~Cancelable () |
Destroy a Cancelable object. | |
virtual void | cancel ()=0 |
virtual bool | isCanceled ()=0 |
Detailed Description
class ZThread::Queue< T >
- Date
- <2003-07-16T11:32:42-0400>
- Version
- 2.3.0
A Queue defines an interface for a value-oriented collection objects (similar to STL collections).
Member Function Documentation
◆ add() [1/2]
|
pure virtual |
Add an object to this Queue.
- Parameters
-
item value to be added to the Queue
- Exceptions
-
Cancellation_Exception thrown if this Queue has been canceled.
- Precondition
- The Queue should not have been canceled prior to the invocation of this function.
- Postcondition
- If no exception is thrown, a copy of item will have been added to the Queue.
Implemented in BlockingQueue< T, LockType, StorageType >, BoundedQueue< T, LockType, StorageType >, LockedQueue< T, LockType, StorageType >, and MonitoredQueue< T, LockType, StorageType >.
◆ add() [2/2]
|
pure virtual |
Add an object to this Queue.
- Parameters
-
item value to be added to the Queue timeout maximum amount of time (milliseconds) this method may block the calling thread.
- Returns
- true if a copy of item can be added before timeout milliseconds elapse.
- false otherwise.
- Exceptions
-
Cancellation_Exception thrown if this Queue has been canceled.
- Precondition
- The Queue should not have been canceled prior to the invocation of this function.
- Postcondition
- If this function returns true a copy of item will have been added to the Queue.
Implemented in BlockingQueue< T, LockType, StorageType >, BoundedQueue< T, LockType, StorageType >, LockedQueue< T, LockType, StorageType >, and MonitoredQueue< T, LockType, StorageType >.
◆ 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.
- Postcondition
- The next() methods will continue to return objects until the Queue has been emptied.
- Once emptied, the next() methods will throw a Cancellation_Exception.
- The add() methods will throw a Cancellation_Exceptions from this point on.
Implements Cancelable.
Implemented in BlockingQueue< T, LockType, StorageType >, BoundedQueue< T, LockType, StorageType >, LockedQueue< T, LockType, StorageType >, and MonitoredQueue< T, LockType, StorageType >.
◆ empty() [1/2]
|
inlinevirtual |
Test whether any values are available in this Queue.
- Returns
- true if there are no values available.
- false if there are values available.
Reimplemented in BoundedQueue< T, LockType, StorageType >, and MonitoredQueue< T, LockType, StorageType >.
◆ empty() [2/2]
|
inlinevirtual |
Test whether any values are available in this Queue.
- Parameters
-
timeout maximum amount of time (milliseconds) this method may block the calling thread.
- Returns
- true if there are no values available.
- false if there are values available.
- Exceptions
-
Timeout_Exception thrown if timeout milliseconds expire before a value becomes available
Reimplemented in BoundedQueue< T, LockType, StorageType >, and MonitoredQueue< T, LockType, StorageType >.
◆ next() [1/2]
|
pure virtual |
Retrieve and remove a value from this Queue.
- Returns
- T next available value
- Exceptions
-
Cancellation_Exception thrown if this Queue has been canceled.
- Precondition
- The Queue should not have been canceled prior to the invocation of this function.
- Postcondition
- The value returned will have been removed from the Queue.
Implemented in BlockingQueue< T, LockType, StorageType >, BoundedQueue< T, LockType, StorageType >, LockedQueue< T, LockType, StorageType >, and MonitoredQueue< T, LockType, StorageType >.
◆ next() [2/2]
|
pure virtual |
Retrieve and remove a value from this Queue.
- Parameters
-
timeout maximum amount of time (milliseconds) this method may block the calling thread.
- Returns
- T next available value
- Exceptions
-
Cancellation_Exception thrown if this Queue has been canceled. Timeout_Exception thrown if the timeout expires before a value can be retrieved.
- Precondition
- The Queue should not have been canceled prior to the invocation of this function.
- Postcondition
- The value returned will have been removed from the Queue.
Implemented in BlockingQueue< T, LockType, StorageType >, BoundedQueue< T, LockType, StorageType >, LockedQueue< T, LockType, StorageType >, and MonitoredQueue< T, LockType, StorageType >.
◆ size() [1/2]
|
pure virtual |
Count the values present in this Queue.
- Returns
- size_t number of elements available in the Queue.
Implemented in BlockingQueue< T, LockType, StorageType >, BoundedQueue< T, LockType, StorageType >, LockedQueue< T, LockType, StorageType >, and MonitoredQueue< T, LockType, StorageType >.
◆ size() [2/2]
|
pure virtual |
Count the values present in this Queue.
- Parameters
-
timeout maximum amount of time (milliseconds) this method may block the calling thread.
- Returns
- size_t number of elements available in the Queue.
- Exceptions
-
Timeout_Exception thrown if timeout milliseconds expire before a value becomes available
Implemented in BlockingQueue< T, LockType, StorageType >, BoundedQueue< T, LockType, StorageType >, LockedQueue< T, LockType, StorageType >, and MonitoredQueue< T, LockType, StorageType >.
The documentation for this class was generated from the following file:
- Queue.h