Main Page Namespace List Class Hierarchy Compound List Compound Members

# ZThread::SimpleQueue Class Template Reference

`#include <SimpleQueue.h>`

Inheritance diagram for ZThread::SimpleQueue::

List of all members.

## Public Methods
| SimpleQueue ()
virtual | ~SimpleQueue () throw ()
virtual void | add (T item) 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 bool | empty () throw (Synchronization_Exception)
## Protected Attributes
std::deque<T> | _data
| Backing deque.
bool | _canceled
| Cancellation flag.

## Detailed Description

### template<class T> class ZThread::SimpleQueue

Date:
  03-10-2001

Author:
  Eric Crahen

Version:
  1.3.0

The SimpleQueue is an un-guarded queue that has no inherent thread safety

## Constructor & Destructor Documentation

SimpleQueue ( | )`[inline]`

| Create a new Queue

~SimpleQueue ( | ) throw ()`[inline, virtual]`

| Destroy the Queue

## Member Function Documentation

void add ( | T item ) throw (Synchronization_Exception)`[inline, virtual]`

  | Add a new object to this Queue Parameters:
  T | object to add
  Exceptions:
  InterruptedException |
  CancelationException | - the queue has been canceled.
  Parameters:
  item |
Reimplemented from ZThread::Queue.

void cancel ( | ) throw (Synchronization_Exception)`[inline, 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::Queue.

bool empty ( | ) throw (Synchronization_Exception)`[inline, 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 from ZThread::Queue.

bool isCanceled ( | ) throw (Synchronization_Exception)`[inline, virtual]`

| Check the cancelation status of this Queue Returns: bool - Queue cancled Reimplemented from ZThread::Cancelable.

T next ( | unsigned long timeout ) throw (Synchronization_Exception)`[inline, 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
  NoSuchElement_Exception | - thrown if the queue is empty
  Parameters:
  timeout |
Reimplemented from ZThread::Queue.

T next ( | ) throw (Synchronization_Exception)`[inline, virtual]`

  | Get an object from this Queue Returns: T next available object Exceptions:
  InterruptedException |
  CancelationException | - the queue is empty and has been canceled.
  NoSuchElement_Exception | - thrown if the queue is empty
Reimplemented from ZThread::Queue.

The documentation for this class was generated from the following file:

- SimpleQueue.h