#include <TPtrListT.hh>
Public Methods | |
TPtrListT () | |
Constructs an empty list. | |
TPtrListT (TPtrListT< T > &list) | |
Copy constructor. | |
~TPtrListT () | |
Destructor. | |
void | Append (T *a) |
Add an element to the end of the list. | |
void | Apply (void(*fn)(T *, void *), void *d) |
Applies the user defined function to every element in the list. | |
void | Clear () |
Remove all elements from the list. | |
void | ClearAndDestroy () |
Remove all elements from the list and calls delete on them. | |
int | Entries () const |
Return the number of entries in the list. | |
T * | First () |
Return the first element of the list. | |
void | Insert (T *a, int i=0) |
Add an element before the specified entry. | |
T * | Last () |
Return the last element of the list. | |
T * | Remove (int i=0) |
Remove element at the specified position. | |
T * | RemoveLast () |
Remove the last element of the list. | |
void | Sort (bool reverse=false) |
Sort all entries in self with the less than operator (<). | |
T *& | operator[] (int i) |
Index operator. | |
TPtrListT< T > & | operator= (const TPtrListT< T > &list) |
Assignment operator. |
|
Applies the user defined function to every element in the list.
|
|
Remove all elements from the list and calls delete on them. Beware of storing duplicate pointers in list! |
|
Return the first element of the list. Null is returned if the list is empty. |
|
Return the last element of the list. Null is returned if the list is empty. |
|
Index operator. Can be used for assignment of list items. |
|
Sort all entries in self with the less than operator (<).
|