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 () throw (Synchronization_Exception)
 Create a LockedQueue.

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

virtual void add (T item) throw (Synchronization_Exception)
virtual bool add (T item, unsigned long timeout) throw (Synchronization_Exception)
virtual T next () throw (Synchronization_Exception)
virtual T next (unsigned long timeout) throw (Synchronization_Exception)
virtual void cancel () throw (Synchronization_Exception)
virtual bool isCanceled () throw (Synchronization_Exception)
virtual size_t size () throw (Synchronization_Exception)
virtual size_t size (unsigned long timeout) throw (Synchronization_Exception)

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
throw (Synchronization_Exception) [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 throw (Synchronization_Exception) [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   throw (Synchronization_Exception) [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   throw (Synchronization_Exception) [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 throw (Synchronization_Exception) [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   throw (Synchronization_Exception) [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 throw (Synchronization_Exception) [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   throw (Synchronization_Exception) [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 Mon Jun 10 22:44:45 2002 for ZThread by doxygen1.2.15