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

RmLinkedList< Type > Class Template Reference

Templated linked list data structure. More...

#include <RmLinkedList.h>

List of all members.

Public Member Functions

 RmLinkedList ()
 Constructor.

 RmLinkedList (const RmLinkedList< Type > &src)
 Copy Constructor.

 ~RmLinkedList ()
int size () const
 Get number of items.

bool empty () const
 Check for empty.

ItemNodeGetHead ()
 Get first itemnode.

const ItemNodeGetHead () const
 Get first itemnode.

ItemNodeGetTail ()
 Get tail of list.

const ItemNodeGetTail () const
 Get tail of list.

bool clear ()
 Clear everything.

Type & front ()
 Get first item.

const Type & front () const
 Get first item.

Type & back ()
 Get last item in list.

const Type & back () const
 Get last item in list.

bool push_back (Type data)
 Add new item to end.

bool push_front (Type data)
 Add new item to front of list.

bool pop_front ()
 Pop front item.

bool pop_back ()
 Pop last item.

bool remove (Type data)
 Remove item.

bool insert (iterator &where, Type data)
 Insert item.

void swap (iterator &itr1, iterator &itr2)
 Swap items.

iterator erase (iterator &itr)
 Remove item by iterator.

iterator begin ()
 Begin iterator.

const_iterator begin () const
 Begin iterator.

iterator end ()
 End iterator.

const_iterator end () const
 End iterator.

Type & operator[] (int nIndex)
 Access item by index.

const Type & operator[] (int nIndex) const
 Access item by index.

void operator= (const RmLinkedList< Type > &src)
 Copy list.

iterator find (Type item)
 Find item.

const_iterator find (Type item) const
 Find item.


Detailed Description

template<class Type>
class RmLinkedList< Type >

Templated linked list data structure.

RmLinkedList provides a templated linked list class, eliminating the need for an external STL implementation. All standard linked list access, iterator, and modifier functions are available through this implementation.

To define the class:

RmLinkedList< TYPE > myLinkedList

To define an iterator to use with the class:

RmLinkedList< TYPE >::iterator myLinkedListIterator;


Constructor & Destructor Documentation

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

Constructor.

Constructor

template<class Type>
RmLinkedList< Type >::RmLinkedList const RmLinkedList< Type > &  src  )  [inline]
 

Copy Constructor.

Copy Constructor

Parameters:
src Source linked list to copy from

template<class Type>
RmLinkedList< Type >::~RmLinkedList  )  [inline]
 

Destructor

Destructor


Member Function Documentation

template<class Type>
const Type& RmLinkedList< Type >::back  )  const [inline]
 

Get last item in list.

Returns the last item in the list

Returns:
Last item in list

template<class Type>
Type& RmLinkedList< Type >::back  )  [inline]
 

Get last item in list.

Returns the last item in the list

Returns:
Last item in list

template<class Type>
const_iterator RmLinkedList< Type >::begin  )  const [inline]
 

Begin iterator.

Returns an iterator initializes to the beginning of the array

Returns:
First item iterator

template<class Type>
iterator RmLinkedList< Type >::begin  )  [inline]
 

Begin iterator.

Returns an iterator initializes to the beginning of the array

Returns:
First item iterator

template<class Type>
bool RmLinkedList< Type >::clear  )  [inline]
 

Clear everything.

Clears out all items in the list

Returns:
True on success

template<class Type>
bool RmLinkedList< Type >::empty  )  const [inline]
 

Check for empty.

Returns true if the list is empty, false otherwise

Returns:
True if list is empty, False otherwise

template<class Type>
const_iterator RmLinkedList< Type >::end  )  const [inline]
 

End iterator.

Returns an iterator initializes to the beginning of the array

Returns:
Last item iterator

template<class Type>
iterator RmLinkedList< Type >::end  )  [inline]
 

End iterator.

Returns an iterator initializes to the beginning of the array

Returns:
Last item iterator

template<class Type>
iterator RmLinkedList< Type >::erase iterator itr  )  [inline]
 

Remove item by iterator.

Removes the item pointed to by the iterator itr from the array

Parameters:
itr Iterator to specify location of item to remove
Returns:
Next iterator, End iterator if last item is removed

template<class Type>
const_iterator RmLinkedList< Type >::find Type  item  )  const [inline]
 

Find item.

Find Function

  • Returns iterator for found item. Return End iterator if not found

Parameters:
item Item to search for
Returns:
If found, return iterator for that item. If not found, returns end iterator

template<class Type>
iterator RmLinkedList< Type >::find Type  item  )  [inline]
 

Find item.

Find Function

  • Returns iterator for found item. Return End iterator if not found

Parameters:
item Item to search for
Returns:
If found, return iterator for that item. If not found, returns end iterator

template<class Type>
const Type& RmLinkedList< Type >::front  )  const [inline]
 

Get first item.

Returns the first item in the list

Returns:
First item in list

template<class Type>
Type& RmLinkedList< Type >::front  )  [inline]
 

Get first item.

Returns the first item in the list

Returns:
First item in list

template<class Type>
const ItemNode* RmLinkedList< Type >::GetHead  )  const [inline]
 

Get first itemnode.

Returns the head of the list

Returns:
First itemnode in list

template<class Type>
ItemNode* RmLinkedList< Type >::GetHead  )  [inline]
 

Get first itemnode.

Returns the head of the list

Returns:
First itemnode in list

template<class Type>
const ItemNode* RmLinkedList< Type >::GetTail  )  const [inline]
 

Get tail of list.

Returns the tail of the list

Returns:
Last itemnode in list

template<class Type>
ItemNode* RmLinkedList< Type >::GetTail  )  [inline]
 

Get tail of list.

Returns the tail of the list

Returns:
Last itemnode in list

template<class Type>
bool RmLinkedList< Type >::insert iterator where,
Type  data
[inline]
 

Insert item.

Inserts an item at a specific location

Parameters:
where Iterator to specify location to insert. This function will insert item before where iterator
data Data to insert
Returns:
True on success

template<class Type>
void RmLinkedList< Type >::operator= const RmLinkedList< Type > &  src  )  [inline]
 

Copy list.

Copy Operator

Parameters:
src Source list to copy from
Returns:
None

template<class Type>
const Type& RmLinkedList< Type >::operator[] int  nIndex  )  const [inline]
 

Access item by index.

Returns the array item at index

Parameters:
nIndex Index to retriev item for
Returns:
Item at index

template<class Type>
Type& RmLinkedList< Type >::operator[] int  nIndex  )  [inline]
 

Access item by index.

Returns the array item at index

Parameters:
nIndex Index to retriev item for
Returns:
Item at index

template<class Type>
bool RmLinkedList< Type >::pop_back  )  [inline]
 

Pop last item.

Pops the last item and remove it from list

Returns:
True on success

template<class Type>
bool RmLinkedList< Type >::pop_front  )  [inline]
 

Pop front item.

Pops the first item and remove it from list

Returns:
True on success

template<class Type>
bool RmLinkedList< Type >::push_back Type  data  )  [inline]
 

Add new item to end.

Pushes a new item to the back of the list

Parameters:
data New data to add
Returns:
True on success

template<class Type>
bool RmLinkedList< Type >::push_front Type  data  )  [inline]
 

Add new item to front of list.

Pushes a new item to the front of the list

Parameters:
data New data to add
Returns:
True on success

template<class Type>
bool RmLinkedList< Type >::remove Type  data  )  [inline]
 

Remove item.

Removes a specific item

Parameters:
data Data to remove
Returns:
True on success

template<class Type>
int RmLinkedList< Type >::size  )  const [inline]
 

Get number of items.

Returns the number if items in the list

Returns:
Number of items in list

template<class Type>
void RmLinkedList< Type >::swap iterator itr1,
iterator itr2
[inline]
 

Swap items.

Swaps two items

Parameters:
itr1 First item in the swap
itr2 Second item in the swap


The documentation for this class was generated from the following file:
Generated on Fri Feb 25 16:09:06 2005 for RenderMonkey SDK by doxygen 1.3.6