- A Logic Circuit Simulation Library in C++





lcs::Queue< T > Class Template Reference

#include <queue.h>

List of all members.


Detailed Description

template<class T>
class lcs::Queue< T >

This is a class which encapsulates a first-in-first-out queue data structure.


Public Member Functions

 Queue (void)
 Queue (const Queue< T > &q)
 ~Queue ()
void enQueue (T element)
void deQueue (void)
getFirstInQueue (void)
int getSize (void)
void purge (void)
void operator= (Queue q)


Constructor & Destructor Documentation

template<class T>
lcs::Queue< T >::Queue ( void   ) 

Default constructor.

template<class T>
lcs::Queue< T >::Queue ( const Queue< T > &  q  ) 

Copy constructor. This is only a shallow coppier. The new object and the original object will denote the same queue.

template<class T>
lcs::Queue< T >::~Queue (  ) 

Destructor.


Member Function Documentation

template<class T>
void lcs::Queue< T >::deQueue ( void   ) 

Removes the first element from the queue.

template<class T>
void lcs::Queue< T >::enQueue ( element  ) 

Adds an element to the end of the queue.

Parameters:
element The element to be added to the end of the queue.

template<class T>
T lcs::Queue< T >::getFirstInQueue ( void   ) 

Returns the first element in the queue.

template<class T>
int lcs::Queue< T >::getSize ( void   )  [inline]

Returns the length of the queue.

template<class T>
void lcs::Queue< T >::operator= ( Queue< T >  q  ) 

The explicit assignment operator. The left lvalue and the rvalue will represent the same queue after the assignment.

template<class T>
void lcs::Queue< T >::purge ( void   ) 

Destroys the queue.


Copyright © 2006, 2007 Siva Chandra