Main Page   Namespace List   Class Hierarchy   Compound List   Namespace Members   Compound Members  

LockedQueue Class Template Reference

#include <LockedQueue.h>

Inheritance diagram for LockedQueue:

Queue Cancelable NonCopyable List of all members.

Public Methods

 LockedQueue ()
 Create a LockedQueue.

virtual ~LockedQueue () throw ()
 Destroy a LockedQueue.

virtual void add (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)

Detailed Description

template<class T, class LockType, typename StorageType = std::deque<T>>
class ZThread::LockedQueue< T, LockType, StorageType >

Author:
Eric Crahen <crahen@cse.buffalo.edu>
Date:
<2002-06-10T07:02:13-0400>
Version:
2.2.1
A LockedQueue is the simple Queue implementation that provides serialized access to the items added to it.


Member Function Documentation

virtual bool add   item,
unsigned long    timeout
[inline, virtual]
 

Adds an object to this Queue.

This method will block the calling thread until exclusive access to the Queue can be obtained, until an exception is thrown or until the given amount of time expires.

Parameters:
item  - object to attempt to add to this Queue
timeout  - maximum amount of time (milliseconds) this method could block
Returns :
true if the item was add()ed before the given timeout expired. Otherwise false
See also:
Queue::add(T, unsigned long)

Implements Queue.

virtual void add   item [inline, virtual]
 

Adds an object to this Queue.

This method will block the calling thread until exclusive access to the Queue can be obtained or until an exception is thrown.

Parameters:
item  - object to attempt to add to this Queue
See also:
Queue::add(T)

Implements Queue.

virtual void cancel   [inline, virtual]
 

Cancel this queue.

This method will block the calling thread until exclusive access to the Queue can be obtained or until an exception is thrown.

See also:
Queue::cancel()

Implements Queue.

virtual bool isCanceled   [inline, virtual]
 

Determine if this Queue has been cancel()ed.

This method will block the calling thread until exclusive access to the Queue can be obtained or until an exception is thrown.

Returns :
bool true if cancel() was called prior to this method, otherwise false.
See also:
Queue::isCanceled()

Implements Cancelable.

virtual T next unsigned long    timeout [inline, virtual]
 

Get an object from this Queue.

This method will block the calling thread until exclusive access to the Queue can be obtained or until an exception is thrown.

Parameters:
timeout  - maximum amount of time (milliseconds) this method could block
Returns :
T next available object
Exceptions:
NoSuchElement_Exception  thrown if the queue is empty.
See also:
Queue::next(unsigned long)

Implements Queue.

virtual T next   [inline, virtual]
 

Get an object from this Queue.

This method will block the calling thread until exclusive access to the Queue can be obtained or until an exception is thrown.

Returns :
T next available object
Exceptions:
NoSuchElement_Exception  thrown if the queue is empty.
See also:
Queue::next()

Implements Queue.

virtual size_t size unsigned long    timeout [inline, virtual]
 

Count the items present in this Queue.

This method will block the calling thread until exclusive access to the Queue can be obtained or until an exception is thrown.

Returns :
size_t number of elements available in the Queue. These are retrievable through the next() methods.
See also:
Queue::size(unsigned long)

Implements Queue.

virtual size_t size   [inline, virtual]
 

Count the items present in this Queue.

This method will block the calling thread until exclusive access to the Queue can be obtained or until an exception is thrown.

Returns :
size_t number of elements available in the Queue. These are retrievable through the next() methods.
See also:
Queue::size()

Implements Queue.


The documentation for this class was generated from the following file:
Generated on Tue Aug 27 07:43:12 2002 for ZThread by doxygen1.2.17