Main Page | User's guide | Class Hierarchy | Class List | File List | Class Members

Multivac::List< T > Class Template Reference

Double linked list. More...

#include <list.hxx>

List of all members.

Public Types

typedef T value_type
typedef T * pointer
typedef const T * const_pointer
typedef T & reference
typedef const T & const_reference

Public Member Functions

 List () throw ()
 Default constructor.

 List (const List< T > &) throw ()
 Copy constructor.

 ~List () throw ()
 Destructor.

void Init ()
 Inits the list.

void Copy (const List< T > &)
 Copies a list.

void AddAtTheEnd (T &X)
 Adds an element at the tail.

void AddAtTheEnd (Cell< T > *NewTail)
 Adds a cell at the tail.

void Reverse ()
 Removes the current cell (cursor) from the list.

Cell< T > * RemoveCurrent ()
 Removes the current cell (cursor) from the list.

void DeleteCurrent ()
Cell< T > * Remove (Cell< T > *cell)
 Removes a given cell (cursor) from the list.

void ClearAll ()
 Clears the list.

const_reference GetHeadValue () const
 Returns the element stored at the head.

const_reference GetCurrentValue () const
 Returns the element stored where the cursor points.

const_reference GetTailValue () const
 Returns the element stored at the tail.

reference GetHeadValue ()
 Returns the element stored at the head.

reference GetCurrentValue ()
 Returns the element stored where the cursor points.

reference GetTailValue ()
 Returns the element stored at the tail.

Cell< T > * GetCurrent () const
 Returns the pointer to the current cell (cursor).

void GoToTheHead ()
 Sets the current cell (cursor) to the pointer to the head.

void GoToTheTail ()
 Sets the current cell (cursor) to the pointer to the tail.

bool GoToNext_StopAtTheTail ()
bool IsEmpty () const
 Is the list empty?


Protected Attributes

Cell< T > * head_
 Pointer to the head.

Cell< T > * current_
 Pointer to the current element ("cursor").

Cell< T > * tail_
 Pointer to the tail.


Detailed Description

template<class T>
class Multivac::List< T >

Double linked list.


Member Function Documentation

template<class T>
void Multivac::List< T >::AddAtTheEnd Cell< T > *  NewTail  )  [inline]
 

Adds a cell at the tail.

Parameters:
NewTail a pointer to the cell to be added.

template<class T>
void Multivac::List< T >::AddAtTheEnd T &  X  )  [inline]
 

Adds an element at the tail.

Parameters:
X the element to be added.

template<class T>
void Multivac::List< T >::ClearAll  )  [inline]
 

Clears the list.

All cells are released from memory.

template<class T>
void Multivac::List< T >::Copy const List< T > &  List_  ) 
 

Copies a list.

Parameters:
List_ the list to be copied.

template<class T>
void Multivac::List< T >::DeleteCurrent  )  [inline]
 

Removes the current cell (cursor) from the list and releases the cell from memory.

template<class T>
Cell< T > * Multivac::List< T >::GetCurrent  )  const [inline]
 

Returns the pointer to the current cell (cursor).

Returns:
the pointer to the current cell (cursor).

template<class T>
List< T >::reference Multivac::List< T >::GetCurrentValue  )  [inline]
 

Returns the element stored where the cursor points.

Returns:
a reference to the element stored by the cell to which the cursor points.

template<class T>
List< T >::const_reference Multivac::List< T >::GetCurrentValue  )  const [inline]
 

Returns the element stored where the cursor points.

Returns:
a constant reference to the element stored by the cell to which the cursor points.

template<class T>
List< T >::reference Multivac::List< T >::GetHeadValue  )  [inline]
 

Returns the element stored at the head.

Returns:
a reference to the element stored by the cell at the head.

template<class T>
List< T >::const_reference Multivac::List< T >::GetHeadValue  )  const [inline]
 

Returns the element stored at the head.

Returns:
a constant reference to the element stored by the cell at the head.

template<class T>
List< T >::reference Multivac::List< T >::GetTailValue  )  [inline]
 

Returns the element stored at the tail.

Returns:
a reference to the element stored by the cell at the tail.

template<class T>
List< T >::const_reference Multivac::List< T >::GetTailValue  )  const [inline]
 

Returns the element stored at the tail.

Returns:
a constant reference to the element stored by the cell at the tail.

template<class T>
bool Multivac::List< T >::GoToNext_StopAtTheTail  )  [inline]
 

Returns:
true if the new current cell has changed and false if the tail is the current cell.

template<class T>
void Multivac::List< T >::Init  )  [inline]
 

Inits the list.

Pointers to the head, to the tail and to the current element are set to NULL.

template<class T>
bool Multivac::List< T >::IsEmpty  )  const [inline]
 

Is the list empty?

Returns:
true if the list is empty and false otherwise.


The documentation for this class was generated from the following files:
Generated on Mon Apr 19 01:59:14 2004 for Multivac by doxygen 1.3.6-20040222