PTLib
Version 2.10.4
|
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>
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) |
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.
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.
Referenced by PQueue< PXML >::Clone().
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.
Remove an object that was added to the queue.
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.
obj | Object to add to the queue. |