csList< T > Class Template Reference
A lightweight double-linked list template. More...
#include <csutil/list.h>
| Public Member Functions | |
| csList (const csList< T > &other) | |
| Copy constructor. | |
| csList () | |
| Default constructor. | |
| void | Delete (Iterator &it) | 
| Remove specific item by iterator. | |
| void | DeleteAll () | 
| Empty an list. | |
| T & | Front () const | 
| Return first element of the list. | |
| void | InsertAfter (Iterator &it, const T &item) | 
| Insert an item after the item the iterator is set to. | |
| void | InsertBefore (Iterator &it, const T &item) | 
| Insert an item before the item the iterator is set to. | |
| bool | IsEmpty () const | 
| T & | Last () const | 
| Return last element of the list. | |
| void | MoveAfter (const Iterator &it, const Iterator &item) | 
| Move an item (as iterator) 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. | |
| csList & | operator= (const csList< T > &other) | 
| Assignment, shallow copy. | |
| bool | PopBack () | 
| Deletes the last element of the list. | |
| bool | PopFront () | 
| Deletes the first element of the list. | |
| Iterator | PushBack (const T &item) | 
| Add an item last in list. Copy T into the listdata. | |
| Iterator | PushFront (const T &item) | 
| Add an item first in list. Copy T into the listdata. | |
| ~csList () | |
| Destructor. | |
| Protected Member Functions | |
| void | Delete (csListElement *el) | 
| Remove specific item by explicit ref. | |
| Friends | |
| class | Iterator | 
| Classes | |
| struct | csListElement | 
| Template which describes the data stored in the linked list For example a list of ints uses csListElement<int>.  More... | |
| class | Iterator | 
| Iterator for the list.  More... | |
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 34 of file list.h.
Constructor & Destructor Documentation
Copy constructor.
Definition at line 269 of file list.h.
References csList< T >::csListElement::data, csList< T >::head, csList< T >::csListElement::next, and csList< T >::PushBack().
Member Function Documentation
Remove specific item by iterator.
Definition at line 424 of file list.h.
References CS_ASSERT, csList< T >::Delete(), csList< T >::Iterator::HasCurrent(), csList< T >::Iterator::IsReverse(), and csList< T >::Iterator::ptr.
| void csList< T >::Delete | ( | csListElement * | el | ) |  [inline, protected] | 
Remove specific item by explicit ref.
Definition at line 439 of file list.h.
References CS_ASSERT, csList< T >::csListElement::next, and csList< T >::csListElement::prev.
Referenced by csList< T >::Delete(), csList< iEventHandler * >::PopBack(), and csList< iEventHandler * >::PopFront().
| void csList< T >::DeleteAll | ( | ) |  [inline] | 
Empty an list.
Definition at line 295 of file list.h.
References csList< T >::csListElement::next.
Referenced by csList< T >::operator=(), csPartialOrder< csStringID >::Solve(), and csList< iEventHandler * >::~csList().
| T& csList< T >::Front | ( | ) | const  [inline] | 
Insert an item after the item the iterator is set to.
Definition at line 334 of file list.h.
References CS_ASSERT, csList< T >::Iterator::HasCurrent(), csList< T >::csListElement::next, csList< T >::csListElement::prev, and csList< T >::Iterator::ptr.
Insert an item before the item the iterator is set to.
Definition at line 349 of file list.h.
References CS_ASSERT, csList< T >::Iterator::HasCurrent(), csList< T >::csListElement::next, csList< T >::csListElement::prev, and csList< T >::Iterator::ptr.
| T& csList< T >::Last | ( | ) | const  [inline] | 
| 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 364 of file list.h.
References CS_ASSERT, csList< T >::Iterator::HasCurrent(), csList< T >::csListElement::next, csList< T >::csListElement::prev, and csList< T >::Iterator::ptr.
| 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 394 of file list.h.
References CS_ASSERT, csList< T >::Iterator::HasCurrent(), csList< T >::csListElement::next, csList< T >::csListElement::prev, and csList< T >::Iterator::ptr.
Assignment, shallow copy.
Definition at line 281 of file list.h.
References csList< T >::csListElement::data, csList< T >::DeleteAll(), csList< T >::head, csList< T >::csListElement::next, and csList< T >::PushBack().
| bool csList< T >::PopBack | ( | ) |  [inline] | 
| bool csList< T >::PopFront | ( | ) |  [inline] | 
Add an item last in list. Copy T into the listdata.
Definition at line 309 of file list.h.
References csList< T >::Iterator, and csList< T >::csListElement::next.
Referenced by csList< T >::csList(), csList< T >::operator=(), and csPartialOrder< csStringID >::Solve().
Add an item first in list. Copy T into the listdata.
Definition at line 322 of file list.h.
References csList< T >::Iterator, and csList< T >::csListElement::prev.
The documentation for this class was generated from the following file:
- csutil/list.h
Generated for Crystal Space by doxygen 1.4.7

