ABA_LIST< Type > Class Template Reference

class ABA_LIST More...

#include <list.h>

Inheritance diagram for ABA_LIST< Type >:

ABA_ABACUSROOT List of all members.

Public Member Functions

 ABA_LIST (const ABA_GLOBAL *glob)
 ~ABA_LIST ()
void appendHead (const Type &elem)
void appendTail (const Type &elem)
int extractHead (Type &elem)
int firstElem (Type &elem) const
 Assign elem the first element as the function extractHead() but does not remove this element from the list.
bool empty () const

Private Member Functions

ABA_LISTITEM< Type > * first () const
ABA_LISTITEM< Type > * last () const
void appendHead (ABA_LISTITEM< Type > *item)
 This version of the function appendHead() adds item at the front of the list.
void appendTail (ABA_LISTITEM< Type > *item)
 This version of the function appendTail() adds item at the end of the list.
 ABA_LIST (const ABA_LIST &rhs)
const ABA_LIST< Type > & operator= (const ABA_LIST< Type > &rhs)

Private Attributes

const ABA_GLOBALglob_
ABA_LISTITEM< Type > * first_
ABA_LISTITEM< Type > * last_

Friends

class ABA_LISTITEM< Type >
ostream & operator<< (ostream &, const ABA_LIST< Type > &list)

Detailed Description

template<class Type>
class ABA_LIST< Type >

class ABA_LIST

Definition at line 56 of file list.h.


Constructor & Destructor Documentation

template<class Type>
ABA_LIST< Type >::ABA_LIST ( const ABA_GLOBAL glob  ) 

The constructor initializes the list with the empty list.

This is done by assigning first_ and last_ to the 0-pointer.

Parameters:
glob A pointer to the corresponding global object.

template<class Type>
ABA_LIST< Type >::~ABA_LIST (  ) 

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

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


Member Function Documentation

template<class Type>
void ABA_LIST< Type >::appendHead ( const Type &  elem  ) 

Adds an element at the front of the list.

Parameters:
elem The element being appended.

template<class Type>
void ABA_LIST< Type >::appendTail ( const Type &  elem  ) 

Adds an element at the end of the list.

Parameters:
elem The element being appended.

template<class Type>
int ABA_LIST< 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 be executed successfully.

1 If the list is empty.

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

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

Assign elem the first element as the function extractHead() but does not remove this element from the list.

Returns:
0 If the operation can be be executed successfully.

1 If the list is empty.

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

template<class Type>
bool ABA_LIST< Type >::empty (  )  const

Returns:
true If no element is contained in the list,

false otherwise.

template<class Type>
ABA_LISTITEM<Type>* ABA_LIST< Type >::first (  )  const [private]

Returns a pointer to the first item in the list.

template<class Type>
ABA_LISTITEM<Type>* ABA_LIST< Type >::last (  )  const [private]

Returns a pointer to the last item in the list.

template<class Type>
void ABA_LIST< Type >::appendHead ( ABA_LISTITEM< Type > *  item  )  [private]

This version of the function appendHead() adds item at the front of the list.

template<class Type>
void ABA_LIST< Type >::appendTail ( ABA_LISTITEM< Type > *  item  )  [private]

This version of the function appendTail() adds item at the end of the list.

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


Friends And Related Function Documentation

template<class Type>
friend class ABA_LISTITEM< Type > [friend]

Definition at line 57 of file list.h.

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

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

Returns:
A reference to the output stream.
Parameters:
out The output stream.
list The list being output.


Member Data Documentation

template<class Type>
const ABA_GLOBAL* ABA_LIST< Type >::glob_ [private]

A pointer to the corresponding global object.

Definition at line 154 of file list.h.

template<class Type>
ABA_LISTITEM<Type>* ABA_LIST< Type >::first_ [private]

A pointer to the first item of the list.

Definition at line 158 of file list.h.

template<class Type>
ABA_LISTITEM<Type>* ABA_LIST< Type >::last_ [private]

Definition at line 162 of file list.h.


The documentation for this class was generated from the following file:
Generated on Tue Aug 14 18:09:57 2007 for ABACUS by  doxygen 1.5.1