DREAM::LinkedList< item_type > Class Template Reference

This class implements a doubly linked list. More...

#include <LinkedList.h>

List of all members.

Public Types

typedef Iterator< LinkedListNode<
item_type > > 
iterator
 iterator class for convenience.
typedef Const_Iterator< LinkedListNode<
item_type > > 
const_iterator
 const_iterator class for convenience.

Public Member Functions

 LinkedList ()
 Constructor.
 ~LinkedList ()
 Destructor.
void assign (const LinkedListNode< item_type > *begin_node, const LinkedListNode< item_type > *end_node)
 Assign operator.
void assign (Iterator< LinkedListNode< item_type > > &begin_iter, Iterator< LinkedListNode< item_type > > &end_iter)
 Assign operator.
void assign (Const_Iterator< LinkedListNode< item_type > > &begin_iter, Const_Iterator< LinkedListNode< item_type > > &end_iter)
 Assign operator.
LinkedListNode< item_type > * begin ()
 Returns a pointer to the smallest element in the LinkedList.
const LinkedListNode< item_type > * begin () const
 Returns a pointer to the smallest element in the LinkedList.
void clear ()
 Erases elements in the LinkedList.
void destroy ()
 Erases elements in the LinkedList, and calls delete on the item_type.
bool empty ()
 Returns true if the LinkedList is empty.
LinkedListNode< item_type > * end ()
 Returns NULL.
const LinkedListNode< item_type > * end () const
 Returns NULL.
void erase (Iterator< LinkedListNode< item_type > > &iter)
 Erase a node from the LinkedList.
LinkedListNode< item_type > * find (Iterator< LinkedListNode< item_type > > &node_iter)
 Finds a LinkedList node in the LinkedList.
const LinkedListNode< item_type > * find (Const_Iterator< LinkedListNode< item_type > > &node_iter) const
 Finds a LinkedList node in the LinkedList.
void push_back (item_type item)
 Insert a LinkedList node in the LinkedList.
LinkedListNode< item_type > * last ()
 Returns a pointer to the last element in the LinkedList.
const LinkedListNode< item_type > * last () const
 Returns a pointer to the last element in the LinkedList.
item_type & operator[] (uint i)
 operator [].
const item_type & operator[] (uint i) const
 operator [].
uint size () const
 Return the number of items in the LinkedList.

Protected Attributes

LinkedListNode< item_type > * root_ptr_
 Pointer to the first element of the linked list.
LinkedListNode< item_type > * last_ptr_
 Pointer to the last element of the linked list.
uint size_
 Stores the number of items in the AVLTree.

Friends

class Iterator< LinkedListNode< item_type > >
 Allow iterators to manipulate protected members.
class Const_Iterator< LinkedListNode< item_type > >
 Allow iterators to manipulate protected members.


Detailed Description

template<class item_type>
class DREAM::LinkedList< item_type >

This class implements a doubly linked list.

Definition at line 146 of file LinkedList.h.


Member Typedef Documentation

template<class item_type>
typedef Iterator<LinkedListNode <item_type> > DREAM::LinkedList< item_type >::iterator

iterator class for convenience.

Definition at line 226 of file LinkedList.h.

template<class item_type>
typedef Const_Iterator<LinkedListNode <item_type> > DREAM::LinkedList< item_type >::const_iterator

const_iterator class for convenience.

Definition at line 229 of file LinkedList.h.


Constructor & Destructor Documentation

template<class item_type>
DREAM::LinkedList< item_type >::LinkedList (  ) 

Constructor.

Definition at line 148 of file LinkedList.cpp.

template<class item_type>
DREAM::LinkedList< item_type >::~LinkedList (  ) 

Destructor.

Definition at line 152 of file LinkedList.cpp.


Member Function Documentation

template<class item_type>
void DREAM::LinkedList< item_type >::assign ( const LinkedListNode< item_type > *  begin_node,
const LinkedListNode< item_type > *  end_node 
)

Assign operator.

Definition at line 159 of file LinkedList.cpp.

template<class item_type>
void DREAM::LinkedList< item_type >::assign ( Iterator< LinkedListNode< item_type > > &  begin_iter,
Iterator< LinkedListNode< item_type > > &  end_iter 
)

Assign operator.

Definition at line 169 of file LinkedList.cpp.

template<class item_type>
void DREAM::LinkedList< item_type >::assign ( Const_Iterator< LinkedListNode< item_type > > &  begin_iter,
Const_Iterator< LinkedListNode< item_type > > &  end_iter 
)

Assign operator.

Definition at line 178 of file LinkedList.cpp.

template<class item_type>
LinkedListNode< item_type > * DREAM::LinkedList< item_type >::begin (  )  [inline]

Returns a pointer to the smallest element in the LinkedList.

Definition at line 187 of file LinkedList.cpp.

Referenced by DREAM::PriorityInversionList::inversion().

template<class item_type>
const LinkedListNode< item_type > * DREAM::LinkedList< item_type >::begin (  )  const [inline]

Returns a pointer to the smallest element in the LinkedList.

Definition at line 193 of file LinkedList.cpp.

template<class item_type>
void DREAM::LinkedList< item_type >::clear (  ) 

Erases elements in the LinkedList.

Definition at line 199 of file LinkedList.cpp.

Referenced by DREAM::PriorityInversionList::destroy().

template<class item_type>
void DREAM::LinkedList< item_type >::destroy (  ) 

Erases elements in the LinkedList, and calls delete on the item_type.

Use this function whenever you would like to iterate through the LinkedList, and erase dynamically allocated data.

Definition at line 210 of file LinkedList.cpp.

Referenced by DREAM::PriorityInversionList::destroy(), and DREAM::PriorityInversionList::~PriorityInversionList().

template<class item_type>
bool DREAM::LinkedList< item_type >::empty (  )  [inline]

Returns true if the LinkedList is empty.

Definition at line 225 of file LinkedList.cpp.

template<class item_type>
LinkedListNode< item_type > * DREAM::LinkedList< item_type >::end (  )  [inline]

Returns NULL.

Definition at line 231 of file LinkedList.cpp.

Referenced by DREAM::PriorityInversionList::increment().

template<class item_type>
const LinkedListNode< item_type > * DREAM::LinkedList< item_type >::end (  )  const [inline]

Returns NULL.

Definition at line 237 of file LinkedList.cpp.

template<class item_type>
void DREAM::LinkedList< item_type >::erase ( Iterator< LinkedListNode< item_type > > &  iter  ) 

Erase a node from the LinkedList.

Definition at line 243 of file LinkedList.cpp.

References DREAM::LinkedListNode< item_type >::left_.

template<class item_type>
LinkedListNode< item_type > * DREAM::LinkedList< item_type >::find ( Iterator< LinkedListNode< item_type > > &  node_iter  ) 

Finds a LinkedList node in the LinkedList.

Definition at line 257 of file LinkedList.cpp.

template<class item_type>
const LinkedListNode< item_type > * DREAM::LinkedList< item_type >::find ( Const_Iterator< LinkedListNode< item_type > > &  node_iter  )  const

Finds a LinkedList node in the LinkedList.

Definition at line 273 of file LinkedList.cpp.

template<class item_type>
void DREAM::LinkedList< item_type >::push_back ( item_type  item  ) 

Insert a LinkedList node in the LinkedList.

Definition at line 289 of file LinkedList.cpp.

References DREAM::LinkedListNode< item_type >::iter_next().

template<class item_type>
LinkedListNode< item_type > * DREAM::LinkedList< item_type >::last (  )  [inline]

Returns a pointer to the last element in the LinkedList.

Definition at line 308 of file LinkedList.cpp.

template<class item_type>
const LinkedListNode< item_type > * DREAM::LinkedList< item_type >::last (  )  const [inline]

Returns a pointer to the last element in the LinkedList.

Definition at line 314 of file LinkedList.cpp.

template<class item_type>
item_type & DREAM::LinkedList< item_type >::operator[] ( uint  i  ) 

operator [].

Definition at line 320 of file LinkedList.cpp.

template<class item_type>
const item_type & DREAM::LinkedList< item_type >::operator[] ( uint  i  )  const

operator [].

Definition at line 333 of file LinkedList.cpp.

template<class item_type>
uint DREAM::LinkedList< item_type >::size (  )  const [inline]

Return the number of items in the LinkedList.

Definition at line 346 of file LinkedList.cpp.

Referenced by DREAM::PriorityInversionList::inversion().


Friends And Related Function Documentation

template<class item_type>
friend class Iterator< LinkedListNode< item_type > > [friend]

Allow iterators to manipulate protected members.

Definition at line 232 of file LinkedList.h.

template<class item_type>
friend class Const_Iterator< LinkedListNode< item_type > > [friend]

Allow iterators to manipulate protected members.

Definition at line 235 of file LinkedList.h.


Member Data Documentation

template<class item_type>
LinkedListNode<item_type>* DREAM::LinkedList< item_type >::root_ptr_ [protected]

Pointer to the first element of the linked list.

Definition at line 151 of file LinkedList.h.

template<class item_type>
LinkedListNode<item_type>* DREAM::LinkedList< item_type >::last_ptr_ [protected]

Pointer to the last element of the linked list.

Definition at line 154 of file LinkedList.h.

template<class item_type>
uint DREAM::LinkedList< item_type >::size_ [protected]

Stores the number of items in the AVLTree.

Definition at line 157 of file LinkedList.h.


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 18:30:04 2007 for DREAM by  doxygen 1.5.1