csList< T > Class Template Reference
A lightweight template double-linked list. More...
#include <list.h>
Public Methods | |
csList () | |
Default constructor. | |
csList (const csList &other) | |
Copy constructor. | |
~csList () | |
Destructor. | |
csList & | operator= (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 | Delete (Iterator &it) |
Remove specific item by iterator. | |
void | DeleteAll () |
Empty an list. | |
const T & | Front () const |
Return first element of the list. | |
const 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 Methods | |
void | Delete (csListElement *el) |
Remove specific item by explicit ref. |
Detailed Description
template<class T>
class csList< T >
A lightweight template double-linked list.
This is VERY lightweight and not tested very well, as it was writen for one single purpose, and it has not been extended to be more general.
Definition at line 29 of file list.h.
Constructor & Destructor Documentation
|
Default constructor.
|
|
Copy constructor.
Definition at line 215 of file list.h. References csList< T >::csListElement::data, csList< T >::csListElement::next, and csList< T >::PushBack(). |
|
Destructor.
Definition at line 67 of file list.h. References csList< T >::DeleteAll(). |
Member Function Documentation
|
Remove specific item by iterator.
Definition at line 308 of file list.h. References csList< T >::Delete(), csList< T >::Iterator::IsReverse(), and csList< T >::Iterator::ptr. |
|
Remove specific item by explicit ref.
Definition at line 324 of file list.h. References csList< T >::csListElement::next, and csList< T >::csListElement::prev. Referenced by csList< T >::Delete(), csList< T >::PopBack(), and csList< T >::PopFront(). |
|
Empty an list.
Definition at line 241 of file list.h. References csList< T >::csListElement::next. Referenced by csList< T >::operator=(), and csList< T >::~csList(). |
|
Return first element of the list.
Definition at line 184 of file list.h. References csList< T >::csListElement::data. |
|
Insert an item after the item the iterator is set to.
Definition at line 294 of file list.h. References 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 280 of file list.h. References csList< T >::csListElement::next, csList< T >::csListElement::prev, and csList< T >::Iterator::ptr. |
|
Return last element of the list.
Definition at line 187 of file list.h. References csList< T >::csListElement::data. |
|
Assignment, shallow copy.
Definition at line 227 of file list.h. References csList< T >::csListElement::data, csList< T >::DeleteAll(), csList< T >::head, csList< T >::csListElement::next, and csList< T >::PushBack(). |
|
Deletes the last element of the list.
Definition at line 200 of file list.h. References csList< T >::Delete(). |
|
Deletes the first element of the list.
Definition at line 191 of file list.h. References csList< T >::Delete(). |
|
Add an item last in list. Copy T into the listdata.
Definition at line 255 of file list.h. References csList< T >::csListElement::next. Referenced by csList< T >::csList(), and csList< T >::operator=(). |
|
Add an item first in list. Copy T into the listdata.
Definition at line 268 of file list.h. References 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.2.18