- A Logic Circuit Simulation Library in C++





lcs::Queue< T > Class Template Reference

#include <queue.h>

Inheritance diagram for lcs::Queue< T >:

lcs::PriorityQueue< T, Order > 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) const
getLastInQueue (void) const
int getSize (void) const
void popLast (void)
void purge (void)
Queue< T > & operator= (const Queue< T > &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   )  const

Returns the first element in the queue.

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

Returns the last element in the queue.

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

Returns the length of the queue.

template<class T>
Queue< T > & lcs::Queue< T >::operator= ( const 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 >::popLast ( void   ) 

Purges the last element in the queue.

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

Destroys the queue.


Copyright © 2006, 2007 Siva Chandra