- A Logic Circuit Simulation Library in C++ |
#include <list.h>
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) |
T | last () const |
T | first () const |
bool | isPresent (const T &t) |
int | getSize (void) |
void | operator= (const List< T > &l) |
Copy constructor. It is only a reference copier.
Destructor. It does consider the number of references to the object before destruction.
void lcs::List< T >::append | ( | T | node | ) |
Appends a node to the end of the list. It is equivalent to push.
void lcs::List< T >::destroy | ( | void | ) |
Destroys the list.
T lcs::List< T >::first | ( | ) | const |
Returns the data in the first node of the list.
ListIterator< T > lcs::List< T >::getListIterator | ( | void | ) |
Returns an iterator for the list.
int lcs::List< T >::getSize | ( | void | ) |
Returns the number of data nodes in the list.
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.
T lcs::List< T >::last | ( | ) | const |
Returns the data in the last node of the list.
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.
void lcs::List< T >::pop | ( | void | ) |
Pops a node from the end of the list. Does nothing in case of an empty list.
void lcs::List< T >::push | ( | T | node | ) |
Pushes a node to the end of the list. It is equivalent to append. Infact push calls the function append.
void lcs::List< T >::removeFirstMatch | ( | T | e | ) |
Removes the first list element equal to the function argument e
.