- A Logic Circuit Simulation Library in C++





lcs::List< T > Class Template Reference

#include <list.h>

List of all members.


Detailed Description

template<class T>
class lcs::List< T >

A class encapsulating a doubly linked list.


Public Member Functions

 List (void)
 List (const List< T > &l)
 ~List ()
void append (T node)
void push (T node)
void pop (void)
ListIterator< T > getListIterator (void)
void removeFirstMatch (T e)
void destroy (void)
last () const
first () const
bool isPresent (const T &t)
int getSize (void)
void operator= (const List< T > &l)


Constructor & Destructor Documentation

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

Default Constructor.

template<class T>
lcs::List< T >::List ( const List< T > &  l  ) 

Copy constructor. It is only a reference copier.

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

Destructor. It does consider the number of references to the object before destruction.


Member Function Documentation

template<class T>
void lcs::List< T >::append ( node  ) 

Appends a node to the end of the list. It is equivalent to push.

template<class T>
void lcs::List< T >::destroy ( void   ) 

Destroys the list.

template<class T>
T lcs::List< T >::first (  )  const

Returns the data in the first node of the list.

template<class T>
ListIterator< T > lcs::List< T >::getListIterator ( void   ) 

Returns an iterator for the list.

template<class T>
int lcs::List< T >::getSize ( void   ) 

Returns the number of data nodes in the list.

template<class T>
bool lcs::List< T >::isPresent ( const T &  t  ) 

Checks if an element is present in the list. Returns true if present, false if not. The type T should support the operator '==' for this function to compile successfully.

template<class T>
T lcs::List< T >::last (  )  const

Returns the data in the last node of the list.

template<class T>
void lcs::List< T >::operator= ( const List< T > &  l  ) 

Assignment operator. It is only a reference copier. i.e., after an assignment operation, the l-value and the r-value share the same data.

template<class T>
void lcs::List< T >::pop ( void   ) 

Pops a node from the end of the list. Does nothing in case of an empty list.

template<class T>
void lcs::List< T >::push ( node  ) 

Pushes a node to the end of the list. It is equivalent to append. Infact push calls the function append.

template<class T>
void lcs::List< T >::removeFirstMatch ( e  ) 

Removes the first list element equal to the function argument e.


Copyright © 2006, 2007 Siva Chandra