Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

List Class Template Reference

Template class representing doubly-linked list. More...

#include <list.h>

Inheritance diagram for List:

Collection List of all members.

Public Methods

 List (void)
 A constructor. More...

virtual ~List (void)
 A destructor. More...

virtual T_ * first (void)
 Get pointer of the data of the first item. More...

virtual T_ * last (void)
 Get pointer of the data of the last item. More...

virtual T_ * current (void)
 Get pointer of the data of the current item. More...

virtual T_ * next (void)
 Get pointer of the data of the next item. More...

virtual T_ * prev (void)
 Get pointer of the data of the previous item. More...

virtual void insert (T_ *item)
 Insert item at current position. More...

virtual void append (T_ *item)
 Append item to the list. More...

virtual void prepend (T_ *item)
 Prepend item to the list. More...

virtual T_ * getFirst (void)
 Remove the first item of the list and return its data. More...

virtual bool remove (void)
 Remove current item. More...

virtual bool remove (T_ *item)
 Remove item with given data. More...

virtual bool contains (T_ *item)
 Test if list contains given item. More...

virtual void clear (void)
 Clear the list. More...


Protected Methods

virtual void initList (void)
 Initialization of the list.


Protected Attributes

ListLinkedList< T_ > * firstNode_
 Pointer to the first node of the list.

ListLinkedList< T_ > * lastNode_
 Pointer to the last node of the list.

ListLinkedList< T_ > * currentNode_
 Pointer to the current node of the list.


Detailed Description

template<class T_>
class List< T_ >

Template class representing doubly-linked list.

Definition at line 55 of file list.h.


Constructor & Destructor Documentation

template<class T_>
List< T_ >::List void    [inline]
 

A constructor.

Calls initList()

Definition at line 63 of file list.h.

template<class T_>
virtual List< T_ >::~List void    [inline, virtual]
 

A destructor.

Calls clear()

Definition at line 70 of file list.h.


Member Function Documentation

template<class T_>
virtual void List< T_ >::append T_ *    item [inline, virtual]
 

Append item to the list.

The new item will become the current item.

Parameters:
item  Pointer to the data.
See also:
remove(), prepend()

Definition at line 244 of file list.h.

Referenced by main.

template<class T_>
virtual void List< T_ >::clear void    [inline, virtual]
 

Clear the list.

If auto deletion is enabled, also the data of the items are removed from memory.

See also:
setAutoDelete()

Implements Collection.

Definition at line 446 of file list.h.

Referenced by List< TestedRule >::~List.

template<class T_>
virtual bool List< T_ >::contains T_ *    item [inline, virtual]
 

Test if list contains given item.

Parameters:
item  Pointer to the data.
Return values:
true  List contains the item.
false  List doesn't contain the item.

Definition at line 421 of file list.h.

template<class T_>
virtual T_* List< T_ >::current void    [inline, virtual]
 

Get pointer of the data of the current item.

Returns:
Pointer to the data.
See also:
first(), last()

Definition at line 118 of file list.h.

template<class T_>
virtual T_* List< T_ >::first void    [inline, virtual]
 

Get pointer of the data of the first item.

Returns:
Pointer to the data.
See also:
last(), current()

Definition at line 80 of file list.h.

Referenced by main.

template<class T_>
virtual T_* List< T_ >::getFirst void    [inline, virtual]
 

Remove the first item of the list and return its data.

Returns:
Pointer to the data.

Definition at line 301 of file list.h.

template<class T_>
virtual void List< T_ >::insert T_ *    item [inline, virtual]
 

Insert item at current position.

The new item will become the current item. If current() is NULL, the will become the first item of the list.

Parameters:
item  Pointer to the data.
See also:
remove()

Definition at line 192 of file list.h.

template<class T_>
virtual T_* List< T_ >::last void    [inline, virtual]
 

Get pointer of the data of the last item.

Returns:
Pointer to the data.
See also:
first(), current()

Definition at line 99 of file list.h.

template<class T_>
virtual T_* List< T_ >::next void    [inline, virtual]
 

Get pointer of the data of the next item.

This next item becomes the current item. If there is no next item, current item will be NULL.

Returns:
Pointer to the data or NULL if there is no next item.
See also:
current()

Definition at line 138 of file list.h.

Referenced by main.

template<class T_>
virtual void List< T_ >::prepend T_ *    item [inline, virtual]
 

Prepend item to the list.

The new item will become the current item.

Parameters:
item  Pointer to the data.
See also:
remove(), append()

Definition at line 275 of file list.h.

template<class T_>
virtual T_* List< T_ >::prev void    [inline, virtual]
 

Get pointer of the data of the previous item.

This previous item becomes the current item. If there is no previous item, current item will be NULL.

Returns:
Pointer to the data or NULL if there is no previous item.
See also:
current()

Definition at line 165 of file list.h.

template<class T_>
virtual bool List< T_ >::remove T_ *    item [inline, virtual]
 

Remove item with given data.

After removal, the current item will be the item following the removed one, or NULL. If auto deletion is enabled, also the data of the item are removed from memory.

Return values:
true  Item has been removed.
false  Item hasn't been removed.
See also:
setAutoDelete(), insert()

Definition at line 391 of file list.h.

template<class T_>
virtual bool List< T_ >::remove void    [inline, virtual]
 

Remove current item.

After removal, the current item will be the item following the removed one, or NULL. If auto deletion is enabled, also the data of the item are removed from memory.

Return values:
true  Item has been removed.
false  Item hasn't been removed.
See also:
setAutoDelete(), insert()

Definition at line 341 of file list.h.

Referenced by List< TestedRule >::remove.


The documentation for this class was generated from the following file:
Generated on Wed Feb 5 10:43:06 2003 for Exalt by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002