PQueue< T > Class Template Reference

#include <lists.h>

Inheritance diagram for PQueue< T >:
PAbstractList PCollection PContainer PObject

List of all members.

Public Member Functions

Construction

 PQueue ()
Overrides from class PObject

virtual PObjectClone () const
New functions for class

virtual void Enqueue (T *obj)
virtual T * Dequeue ()

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 { not} 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.

References PCollection::DisallowDeleteObjects().

Referenced by PQueue< T >::Clone().

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.

References PNEW, and PQueue< T >::PQueue().

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.

References PContainer::GetSize(), and PAbstractList::RemoveAt().

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.

References PAbstractList::Append().


The documentation for this class was generated from the following file:
Generated on Fri May 28 07:32:34 2010 for PTLib by  doxygen 1.6.3