QueueArray Class Template Reference

An array-based queue. More...

#include <QueueArray.h>

List of all members.

Public Methods

 QueueArray ()
 Empty constructor that sets up an empty queue.

virtual ~QueueArray ()
 Destructor.

virtual T & top ()
 Returns the value at the top of the queue, which is the next element that will be removed.

virtual void add (const T &)
 Adds a list item with data value data.

virtual void remove (T &val)
 Removes the next item, and returns the data value in data.

int empty () const
 Returns TRUE if the queue is empty and FALSE otherwise.

 operator int () const
 Returns TRUE if the queue is empty and FALSE otherwise.

size_type len () const
 Returns the number of items in the queue.

void clear ()
 Empties the QueueArray.

void write (ostream &os) const
 Write out the queue to an output stream.

void read (istream &is)
 Read the queue from an input stream.

void write (PackBuffer &os) const
 Write out the queue from a pack buffer.

void read (UnPackBuffer &is)
 Read the queue from an unpack buffer.


Protected Attributes

size_type Len
 The number of items in the queue.

size_type First
 The index of the first element in the queue.

size_type Last
 The index of the last element in the queue.

BasicArray< T > Data
 The array used for storing the queue.

BasicArray< size_tnext
 The array of next elements in the queue.


Detailed Description

template<class T>
class QueueArray< T >

An array-based queue.


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