LinkedList_t< T > Class Template Reference

Template linked list class. The template type T must inherit from LinkedListNode_t < class T >.

#include <UTLists.h>

Inheritance diagram for LinkedList_t< T >:
OwnedLinkedList_t< T >

List of all members.

Public Member Functions

 LinkedList_t ()
T * AddHead (T *item)
T * AddTail (T *item)
T * AddItemBefore (T *new_item, T *after_item)
T * AddItemAfter (T *before_item, T *new_item)
T * RemoveHead ()
T * RemoveTail ()
T * RemoveItem (T *item)
int CountItems () const
T * Head () const
T * Tail () const
void operator+= (T *item)
void operator-= (T *item)
void SortSmallOrSlow ()

Detailed Description

template<class T>
class LinkedList_t< T >

Definition at line 199 of file UTLists.h.


Constructor & Destructor Documentation

template<class T >
LinkedList_t< T >::LinkedList_t (  )  [inline]

Constructor for an empty list.

Definition at line 1653 of file UTLists.h.


Member Function Documentation

template<class T>
T * LinkedList_t< T >::AddHead ( T *  item  )  [inline]

Adds an item to the head of the list.

Definition at line 1663 of file UTLists.h.

template<class T>
T * LinkedList_t< T >::AddTail ( T *  item  )  [inline]

Adds an item to the end of the list.

Definition at line 1686 of file UTLists.h.

template<class T>
T * LinkedList_t< T >::AddItemBefore ( T *  new_item,
T *  after_item 
) [inline]

Adds new_item to the list before after_item.

Definition at line 1709 of file UTLists.h.

template<class T>
T * LinkedList_t< T >::AddItemAfter ( T *  before_item,
T *  new_item 
) [inline]

Adds new_item to the list after before_item.

Definition at line 1732 of file UTLists.h.

template<class T >
T * LinkedList_t< T >::RemoveHead (  )  [inline]

Removes and returns the item at the head of the list.

Definition at line 1754 of file UTLists.h.

template<class T >
T * LinkedList_t< T >::RemoveTail (  )  [inline]

Removes and returns the item at the end of the list.

Definition at line 1779 of file UTLists.h.

template<class T>
T * LinkedList_t< T >::RemoveItem ( T *  item  )  [inline]

Removes and returns the specified item.

Definition at line 1803 of file UTLists.h.

template<class T >
int LinkedList_t< T >::CountItems (  )  const [inline]

Returns the number of items in the list.

Definition at line 1848 of file UTLists.h.

template<class T >
T * LinkedList_t< T >::Head (  )  const [inline]

Returns the item at the head of the list. Use LinkedListNode_t < class T >Next to walk the list.

Definition at line 1856 of file UTLists.h.

template<class T >
T * LinkedList_t< T >::Tail (  )  const [inline]

Returns the item at the end of the list. Use LinkedListNode_t < class T >Prev to walk the list.

Definition at line 1864 of file UTLists.h.

template<class T>
void LinkedList_t< T >::operator+= ( T *  item  )  [inline]

Adds an item to the end of the list.

Definition at line 1872 of file UTLists.h.

template<class T>
void LinkedList_t< T >::operator-= ( T *  item  )  [inline]

Removes the specified item from the list.

Definition at line 1880 of file UTLists.h.

template<class T >
void LinkedList_t< T >::SortSmallOrSlow (  )  [inline]

Sorts the linked list. LinkedListNode_t must implement an operator <, in the form of (inline being optional):
inline bool operator <(const T& other) const;
This performs a bubble sort, and thus is inherently slow and should only be performed on reasonably small linked lists.

Definition at line 1888 of file UTLists.h.


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

Generated on Tue Dec 14 22:35:07 2010 for UT library by  doxygen 1.6.1