Main Page   Namespace List   Class Hierarchy   Compound List   Compound Members  

ZThread::Queue Class Template Reference

#include <Queue.h>

Inheritance diagram for ZThread::Queue::

ZThread::Cancelable ZThread::BlockingQueue ZThread::BufferedQueue ZThread::LockedQueue ZThread::MonitoredQueue ZThread::SimpleQueue List of all members.

Public Methods

virtual void add (T)=0 throw (Synchronization_Exception)
virtual T next ()=0 throw (Synchronization_Exception)
virtual T next (unsigned long)=0 throw (Synchronization_Exception)
virtual void cancel ()=0 throw (Synchronization_Exception)
virtual bool empty ()=0 throw (Synchronization_Exception)

Detailed Description

template<class T> class ZThread::Queue

Date:
03-10-2001
Author:
Eric Crahen
Version:
1.3.0

A Queue defines an important common interface for collections. It can be implemented using different forms of protection and synchronization.


Member Function Documentation

void add ( T item ) throw (Synchronization_Exception) [pure virtual]
 

Add a new object to this Queue

Parameters:
T   object to add
Exceptions:
InterruptedException  
CancelationException   - the queue has been canceled.
Parameters:
item  

Reimplemented in ZThread::BlockingQueue, ZThread::BufferedQueue, ZThread::LockedQueue, ZThread::MonitoredQueue, and ZThread::SimpleQueue.

void cancel ( ) throw (Synchronization_Exception) [pure virtual]
 

Cancel this queue. No more objects can be added to it

Exceptions:
InterruptedException  

Postcondition:
- The next() method will continue to return objects until the queue has been emptied. After the queue is emptied, further calls to next() will throw CancelationException

The add() method will begin to throw CancelationException and no item will be accepted by this queue

Reimplemented from ZThread::Cancelable.

Reimplemented in ZThread::BlockingQueue, ZThread::BufferedQueue, ZThread::LockedQueue, ZThread::MonitoredQueue, and ZThread::SimpleQueue.

bool empty ( ) throw (Synchronization_Exception) [pure virtual]
 

Test this queue to see if it is empty. This method may or may not block the caller, it is completely up to the implementation to decide weather or not it is appropriate to block the caller.

Returns:
boolean - true if empty
Exceptions:
InterruptedException  

Reimplemented in ZThread::BlockingQueue, ZThread::BufferedQueue, ZThread::LockedQueue, ZThread::MonitoredQueue, and ZThread::SimpleQueue.

T next ( unsigned long timeout ) throw (Synchronization_Exception) [pure virtual]
 

Get an object from this Queue within a given amount of time

Parameters:
unsigned   long time limit

Returns:
T next available object
Exceptions:
InterruptedException  
CancelationException   - the queue is empty and has been canceled.
Timeout_Exception   - thrown if the given amount of time has expired and the queue could not return an item
Parameters:
timeout  

Reimplemented in ZThread::BlockingQueue, ZThread::BufferedQueue, ZThread::LockedQueue, ZThread::MonitoredQueue, and ZThread::SimpleQueue.

T next ( ) throw (Synchronization_Exception) [pure virtual]
 

Get an object from this Queue

Returns:
T next available object
Exceptions:
InterruptedException  
CancelationException   - the queue is empty and has been canceled.

Reimplemented in ZThread::BlockingQueue, ZThread::BufferedQueue, ZThread::LockedQueue, ZThread::MonitoredQueue, and ZThread::SimpleQueue.


The documentation for this class was generated from the following file:
Generated at Fri Aug 31 09:08:01 2001 for ZThread by doxygen1.2.8 written by Dimitri van Heesch, © 1997-2001