CrystalSpace

Public API Reference

Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

csList< T > Class Template Reference

A lightweight double-linked list template. More...

#include <csutil/list.h>

List of all members.

Public Member Functions

 csList ()
 Default constructor.
 csList (const csList &other)
 Copy constructor.
 ~csList ()
 Destructor.
csListoperator= (const csList &other)
 Assignment, shallow copy.
Iterator PushFront (const T &item)
 Add an item first in list. Copy T into the listdata.
Iterator PushBack (const T &item)
 Add an item last in list. Copy T into the listdata.
void InsertBefore (Iterator &it, const T &item)
 Insert an item before the item the iterator is set to.
void InsertAfter (Iterator &it, const T &item)
 Insert an item after the item the iterator is set to.
void MoveBefore (const Iterator &it, const Iterator &item)
 Move an item (as iterator) before the item the iterator is set to.
void MoveAfter (const Iterator &it, const Iterator &item)
 Move an item (as iterator) after the item the iterator is set to.
void Delete (Iterator &it)
 Remove specific item by iterator.
void DeleteAll ()
 Empty an list.
T & Front () const
 Return first element of the list.
T & Last () const
 Return last element of the list.
bool PopFront ()
 Deletes the first element of the list.
bool PopBack ()
 Deletes the last element of the list.

Protected Member Functions

void Delete (csListElement *el)
 Remove specific item by explicit ref.


Detailed Description

template<class T>
class csList< T >

A lightweight double-linked list template.

Copies the elements into the list for storages. Assumes that type T supports copy construction.

Definition at line 30 of file list.h.


Constructor & Destructor Documentation

template<class T>
csList< T >::csList  )  [inline]
 

Default constructor.

Definition at line 58 of file list.h.

template<class T>
csList< T >::csList const csList< T > &  other  )  [inline]
 

Copy constructor.

Definition at line 265 of file list.h.

References csList< T >::csListElement::data, csList< T >::head, csList< T >::csListElement::next, and csList< T >::PushBack().

template<class T>
csList< T >::~csList  )  [inline]
 

Destructor.

Definition at line 64 of file list.h.


Member Function Documentation

template<class T>
void csList< T >::Delete Iterator it  )  [inline]
 

Remove specific item by iterator.

Definition at line 420 of file list.h.

References csList< T >::Delete(), csList< T >::Iterator::HasCurrent(), csList< T >::Iterator::IsReverse(), and csList< T >::Iterator::ptr.

template<class T>
void csList< T >::Delete csListElement el  )  [inline, protected]
 

Remove specific item by explicit ref.

Definition at line 435 of file list.h.

References csList< T >::csListElement::next, and csList< T >::csListElement::prev.

Referenced by csList< T >::Delete(), csList< int >::PopBack(), and csList< int >::PopFront().

template<class T>
void csList< T >::DeleteAll  )  [inline]
 

Empty an list.

Definition at line 291 of file list.h.

References csList< T >::csListElement::next.

Referenced by csList< T >::operator=().

template<class T>
T& csList< T >::Front  )  const [inline]
 

Return first element of the list.

Definition at line 228 of file list.h.

template<class T>
void csList< T >::InsertAfter Iterator it,
const T &  item
[inline]
 

Insert an item after the item the iterator is set to.

Definition at line 330 of file list.h.

References csList< T >::Iterator::HasCurrent(), csList< T >::csListElement::next, csList< T >::csListElement::prev, and csList< T >::Iterator::ptr.

template<class T>
void csList< T >::InsertBefore Iterator it,
const T &  item
[inline]
 

Insert an item before the item the iterator is set to.

Definition at line 345 of file list.h.

References csList< T >::Iterator::HasCurrent(), csList< T >::csListElement::next, csList< T >::csListElement::prev, and csList< T >::Iterator::ptr.

template<class T>
T& csList< T >::Last  )  const [inline]
 

Return last element of the list.

Definition at line 231 of file list.h.

template<class T>
void csList< T >::MoveAfter const Iterator it,
const Iterator item
[inline]
 

Move an item (as iterator) after the item the iterator is set to.

Definition at line 360 of file list.h.

References csList< T >::Iterator::HasCurrent(), csList< T >::csListElement::next, csList< T >::csListElement::prev, and csList< T >::Iterator::ptr.

template<class T>
void csList< T >::MoveBefore const Iterator it,
const Iterator item
[inline]
 

Move an item (as iterator) before the item the iterator is set to.

Definition at line 390 of file list.h.

References csList< T >::Iterator::HasCurrent(), csList< T >::csListElement::next, csList< T >::csListElement::prev, and csList< T >::Iterator::ptr.

template<class T>
csList< T > & csList< T >::operator= const csList< T > &  other  )  [inline]
 

Assignment, shallow copy.

Definition at line 277 of file list.h.

References csList< T >::csListElement::data, csList< T >::DeleteAll(), csList< T >::head, csList< T >::csListElement::next, and csList< T >::PushBack().

template<class T>
bool csList< T >::PopBack  )  [inline]
 

Deletes the last element of the list.

Definition at line 244 of file list.h.

template<class T>
bool csList< T >::PopFront  )  [inline]
 

Deletes the first element of the list.

Definition at line 235 of file list.h.

template<class T>
typename_qualifier csList< T >::Iterator csList< T >::PushBack const T &  item  )  [inline]
 

Add an item last in list. Copy T into the listdata.

Definition at line 305 of file list.h.

References csList< T >::csListElement::next.

Referenced by csList< T >::csList(), and csList< T >::operator=().

template<class T>
typename_qualifier csList< T >::Iterator csList< T >::PushFront const T &  item  )  [inline]
 

Add an item first in list. Copy T into the listdata.

Definition at line 318 of file list.h.

References csList< T >::csListElement::prev.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.3.9.1