AEM
Q< T > Class Template Reference

#include <staticQ.h>

Public Member Functions

 Q (T nullOb)
 
boolean push (T elt)
 
pop ()
 
unsigned int qNbObjects () const
 
boolean full () const
 
int qLength () const
 

Protected Attributes

unsigned int pptr = 0
 
unsigned int gptr = 0
 
unsigned int qNbObj = 0
 
q [qLen]
 
nullObject
 

Static Protected Attributes

static const unsigned int qLen = Q_Q_LENGTH
 
static const boolean overrunDeleteOldest = (boolean) Q_OVERRUN_DELETE_OLDEST
 

Constructor & Destructor Documentation

template<class T>
Q< T >::Q ( nullOb)

constructor, sets the nullObject

Member Function Documentation

template<class T>
boolean Q< T >::full ( ) const

returns true if full, false otherwise

Returns
true if full, false otherwise
template<class T>
T Q< T >::pop ( )

pops the oldest elt off the queue

Returns
the elt popped, or nullObject if queue is empty. the elt is not deleted from heap.
template<class T>
boolean Q< T >::push ( elt)

copy a new elt onto the queue

Parameters
eltthe elt to be enqueued
Returns
boolean TRUE if enqueued
template<class T>
int Q< T >::qLength ( ) const

return nb elts in queue

Returns
nb elts in queue
template<class T>
unsigned int Q< T >::qNbObjects ( ) const

returns the number of objects in the queue

Returns
number of objects in queue

Field Documentation

template<class T>
unsigned int Q< T >::gptr = 0
protected

index of the next spot to get an elt

template<class T>
T Q< T >::nullObject
protected
template<class T>
const boolean Q< T >::overrunDeleteOldest = (boolean) Q_OVERRUN_DELETE_OLDEST
staticprotected

if true when queue is full, delete oldest elt, otherwise do not enqueue new elts

template<class T>
unsigned int Q< T >::pptr = 0
protected

index of the next spot to put an elt

template<class T>
T Q< T >::q[qLen]
protected
template<class T>
const unsigned int Q< T >::qLen = Q_Q_LENGTH
staticprotected

max nb of elts that the queue can contain

template<class T>
unsigned int Q< T >::qNbObj = 0
protected

nb of elts in queue


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