6.59 ABA_DLIST< Type > Class Template Reference

class ABA_DLIST implements a doubly linked linear list. The list is implemented by a doubly linked list of ABA_DLISTITEMs.

#include <dlist.h>

Inheritance diagram for ABA_DLIST< Type >::


PIC


Public Member Functions

Private Member Functions

Private Attributes

Friends

6.59.1 Detailed Description

template<class Type> class ABA_DLIST< Type >

class ABA_DLIST implements a doubly linked linear list. The list is implemented by a doubly linked list of ABA_DLISTITEMs.

Definition at line 62 of file dlist.h.

6.59.2 Constructor & Destructor Documentation

6.59.2.1 template<class Type> ABA_DLIST< Type >::ABA_DLIST (ABA_GLOBAL * glob)

The constructor for an empty list.

Parameters:

glob
A pointer to the corresponding global object.

6.59.2.2 template<class Type> ABA_DLIST< Type >::~ABA_DLIST ()

The destructor deallocates the memory of all items in the list.

6.59.2.3 template<class Type> ABA_DLIST< Type >::ABA_DLIST (const ABA_DLIST< Type > & rhs) [private]

6.59.3 Member Function Documentation

6.59.3.1 template<class Type> void ABA_DLIST< Type >::append (const Type & elem)

Adds an element at the end of the list.

Parameters:

elem
The element being appended.

6.59.3.2 template<class Type> int ABA_DLIST< Type >::extractHead (Type & elem)

Assigns to elem the first element in the list and removes it from the list.

Returns:

0 If the operation can be executed successfully.

1 If the list is empty.

Parameters:

elem
If the list is nonemty, the first element is assigned to elem.

6.59.3.3 template<class Type> int ABA_DLIST< Type >::removeHead ()

If the list is non-empty, the function removeHead() removes the head of the list.

Returns:

0 If the list is non-empty before the function is called,

1 otherwise.

6.59.3.4 template<class Type> void ABA_DLIST< Type >::remove (const Type & elem)

The function remove() removes item from the list.

6.59.3.5 template<class Type> void ABA_DLIST< Type >::remove (ABA_DLISTITEM< Type > * item)

This version of the function remove() scans the list for an item with element elem beginning at the first element of the list.

The first matching item is removed from the list.

Parameters:

elem
The element which should be removed.

6.59.3.6 template<class Type> ABA_DLISTITEM<Type>*ABA_DLIST< Type >::first () const

Returns a pointer to the first item of the list.

6.59.3.7 template<class Type> ABA_DLISTITEM<Type>*ABA_DLIST< Type >::last () const

Returns a pointer to the last item of the list.

6.59.3.8 template<class Type> bool ABA_DLIST< Type >::empty () const

Returns:

true If no element is contained in the list,

false otherwise.

6.59.3.9 template<class Type> int ABA_DLIST< Type >::firstElem (Type & elem) const

Retrieves the first element of the list.

Returns:

0 If the list is not empty,

1 otherwise.

Parameters:

elem
Stores the first element of the list after the function call if the list is not empty.

6.59.3.10 template<class Type> const ABA_DLIST<Type>& ABA_DLIST< Type >::operator= (const ABA_DLIST< Type > & rhs) [private]

6.59.4 Friends And Related Function Documentation

6.59.4.1 template<class Type> ostream& operator<< (ostream &, const ABA_DLIST< Type > & list) [friend]

The output operator writes all elements of the list on an output stream.

Returns:

A reference to the output stream.

Parameters:

out
The output stream.
list
The list being output.

6.59.5 Member Data Documentation

6.59.5.1 template<class Type> ABA_GLOBAL*ABA_DLIST< Type >::glob_ [private]

A pointer to corresponding global object.

Definition at line 162 of file dlist.h.

6.59.5.2 template<class Type> ABA_DLISTITEM<Type>*ABA_DLIST< Type >::first_ [private]

A pointer to the first item of the list.

Definition at line 166 of file dlist.h.

6.59.5.3 template<class Type> ABA_DLISTITEM<Type>*ABA_DLIST< Type >::last_ [private]

A pointer to the last item in the list.

Definition at line 170 of file dlist.h.

The documentation for this class was generated from the following file: