Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

List< Type > Class Template Reference

This class is a basic doubly linked list, with the node metadata actually stored in each element. More...

#include <list.h>

Inheritance diagram for List< Type >:

Inheritance graph
[legend]
Collaboration diagram for List< Type >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef List_iterator< Type > Iterator

Public Member Functions

 List ()
void clear ()
void free_and_clear ()
Type * front ()
Type * back ()
Iterator begin ()
Iterator end ()
bool is_empty () const
unsigned size () const
Iterator insert (Iterator position, Type *element)
Iterator insert_front (Type *element)
Iterator insert_back (Type *element)
Type * remove (Iterator position)
Type * remove (Type *element)
Type * remove_front ()
Type * remove_back ()
void print ()

Protected Attributes

List_node sentinel

Detailed Description

template<class Type>
class List< Type >

This class is a basic doubly linked list, with the node metadata actually stored in each element.


Member Typedef Documentation

template<class Type>
typedef List_iterator<Type> List< Type >::Iterator
 


Constructor & Destructor Documentation

template<class Type>
List< Type >::List  )  [inline]
 


Member Function Documentation

template<class Type>
Type * List< Type >::back  )  [inline]
 

template<class Type>
List_iterator< Type > List< Type >::begin  )  [inline]
 

template<class Type>
void List< Type >::clear  )  [inline]
 

Clear the list of all nodes.

template<class Type>
List_iterator< Type > List< Type >::end  )  [inline]
 

template<class Type>
void List< Type >::free_and_clear  )  [inline]
 

Free each node in the list, and then clear() the list.

This function assumes that the list nodes were initially allocated from virtual memory and that nothing else is going to free them.

template<class Type>
Type * List< Type >::front  )  [inline]
 

template<class Type>
List_iterator< Type > List< Type >::insert Iterator  position,
Type *  element
[inline]
 

template<class Type>
List_iterator< Type > List< Type >::insert_back Type *  element  )  [inline]
 

template<class Type>
List_iterator< Type > List< Type >::insert_front Type *  element  )  [inline]
 

template<class Type>
bool List< Type >::is_empty  )  const [inline]
 

template<class Type>
void List< Type >::print  ) 
 

Print a list as its address, the addresses of its elements, and a newline.

template<class Type>
Type * List< Type >::remove Type *  element  )  [inline]
 

template<class Type>
Type * List< Type >::remove Iterator  position  )  [inline]
 

template<class Type>
Type * List< Type >::remove_back  )  [inline]
 

template<class Type>
Type * List< Type >::remove_front  )  [inline]
 

template<class Type>
unsigned List< Type >::size  )  const
 


Member Data Documentation

template<class Type>
List_node List< Type >::sentinel [protected]
 


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

Torsion Operating System, Copyright (C) 2000-2004 Dan Helfman