# PQueue< T > Class Template Reference

This template class maps the PAbstractList to a specific object type, and adds functionality that allows the list to be used as a first in first out queue. More...

`#include <lists.h>`

Inheritance diagram for PQueue< T >:

List of all members.

## Public Member Functions

Construction
| PQueue ()
| Create a new, empty, queue.
Overrides from class PObject
virtual PObject * | Clone () const
| Make a complete duplicate of the list.
New functions for class
virtual void | Enqueue (T *obj)
| Add a new object to the queue.
virtual T * | Dequeue ()
| Remove an object that was added to the queue.

## Protected Member Functions

| PQueue (int dummy, const PQueue *c)

## Detailed Description

### template<class T>
class PQueue< T >

This template class maps the PAbstractList to a specific object type, and adds functionality that allows the list to be used as a first in first out queue.

The functions in this class primarily do all the appropriate casting of types.

By default, objects placed into the set will T be deleted when removed or when all references to the set are destroyed. This is different from the default on most collection classes.

Note that if templates are not used the `PDECLARE_QUEUE` macro will simulate the template instantiation.

## Constructor & Destructor Documentation

template<class T>

PQueue< T >::PQueue | ( |  | ) | `[inline]`

Create a new, empty, queue.

Note that by default, objects placed into the queue will not be deleted when removed or when all references to the queue are destroyed. This is different from the default on most collection classes.

template<class T>

PQueue< T >::PQueue | ( | int | dummy,
|  | const PQueue< T > * | c |
| ) |  |  | `[inline, protected]`

## Member Function Documentation

template<class T>

virtual PObject* PQueue< T >::Clone | ( |  | ) | const`[inline, virtual]`

Make a complete duplicate of the list.

Note that all objects in the array are also cloned, so this will make a complete copy of the list.

Reimplemented from PObject.

template<class T>

virtual T* PQueue< T >::Dequeue | ( |  | ) | `[inline, virtual]`

Remove an object that was added to the queue.

Returns:
  first object added to the queue or NULL if queue empty.

template<class T>

virtual void PQueue< T >::Enqueue | ( | T * | obj | ) | `[inline, virtual]`

Add a new object to the queue.

This places a new link at the "tail" of the list, which is the "in" side of the queue.

Parameters:

  obj | Object to add to the queue.

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

- lists.h