#include <include/EST_TList.h>
Classes | |
class | IPointer |
Public Types | |
typedef T | Entry |
typedef EST_TIterator< EST_TList< T >, IPointer, T > | Entries |
typedef EST_TRwIterator< EST_TList< T >, IPointer, T > | RwEntries |
Public Member Functions | |
void | init () |
Constructor functions | |
EST_TList () | |
default constructor More... | |
EST_TList (const EST_TList< T > &l) | |
copy constructor More... | |
~EST_TList () | |
Access functions for reading and writing items. | |
See EST_TList_Accessing for examples. | |
T & | item (const EST_Litem *p) |
const T & | item (const EST_Litem *p) const |
T & | nth (int n) |
return the Nth value More... | |
const T & | nth (int n) const |
return a const Nth value More... | |
const T & | first () const |
return const reference to first item in list More... | |
const T & | last () const |
return const reference to last item in list More... | |
T & | first () |
T & | last () |
return reference to last item in list More... | |
const T & | operator() (const EST_Litem *ptr) const |
return const reference to item in list pointed to by ptr More... | |
T & | operator() (const EST_Litem *ptr) |
return non-const reference to item in list pointed to by ptr More... | |
Removing items in a list. | |
EST_Litem * | remove (EST_Litem *ptr) |
EST_Litem * | remove_nth (int n) |
remove nth item, return pointer to previous item More... | |
Adding items to a list. | |
In all cases, a complete copy of the item is made and added to the list. See Addition for examples. | |
void | append (const T &item) |
add item onto end of list More... | |
void | prepend (const T &item) |
add item onto start of list More... | |
EST_Litem * | insert_after (EST_Litem *ptr, const T &item) |
EST_Litem * | insert_before (EST_Litem *ptr, const T &item) |
Public Member Functions inherited from EST_UList | |
EST_UList () | |
virtual | ~EST_UList () |
EST_UItem * | nth_pointer (int n) const |
EST_UItem * | insert_after (EST_UItem *ptr, EST_UItem *new_item) |
EST_UItem * | insert_before (EST_UItem *ptr, EST_UItem *new_item) |
EST_UItem * | remove (EST_UItem *ptr, void(*item_free)(EST_UItem *item)) |
EST_UItem * | remove (int n, void(*item_free)(EST_UItem *item)) |
void | exchange (EST_UItem *a, EST_UItem *b) |
void | exchange (int i, int j) |
void | reverse () |
int | length () const |
int | index (EST_UItem *item) const |
int | empty () const |
void | clear (void) |
void | append (EST_UItem *item) |
void | prepend (EST_UItem *item) |
EST_UItem * | head () const |
EST_UItem * | tail () const |
Static Public Member Functions | |
static void | free_item (EST_UItem *item) |
Static Public Member Functions inherited from EST_UList | |
static bool | operator_eq (const EST_UList &a, const EST_UList &b, bool(*eq)(const EST_UItem *item1, const EST_UItem *item2)) |
static int | index (const EST_UList &l, const EST_UItem &b, bool(*eq)(const EST_UItem *item1, const EST_UItem *item2)) |
static void | sort (EST_UList &a, bool(*gt)(const EST_UItem *item1, const EST_UItem *item2)) |
static void | qsort (EST_UList &a, bool(*gt)(const EST_UItem *item1, const EST_UItem *item2), void(*exchange)(EST_UItem *item1, EST_UItem *item2)) |
static void | sort_unique (EST_UList &l, bool(*eq)(const EST_UItem *item1, const EST_UItem *item2), bool(*gt)(const EST_UItem *item1, const EST_UItem *item2), void(*item_free)(EST_UItem *item)) |
static void | merge_sort_unique (EST_UList &l, EST_UList &m, bool(*eq)(const EST_UItem *item1, const EST_UItem *item2), bool(*gt)(const EST_UItem *item1, const EST_UItem *item2), void(*item_free)(EST_UItem *item)) |
Protected Member Functions | |
void | point_to_first (IPointer &ip) const |
void | move_pointer_forwards (IPointer &ip) const |
bool | points_to_something (const IPointer &ip) const |
T & | points_at (const IPointer &ip) |
Protected Member Functions inherited from EST_UList | |
void | init () |
void | clear_and_free (void(*item_free)(EST_UItem *item)) |
Friends | |
class | EST_TIterator< EST_TList< T >, IPointer, T > |
class | EST_TRwIterator< EST_TList< T >, IPointer, T > |
Exchange | |
void | exchange (EST_Litem *a, EST_Litem *b) |
exchange 1 More... | |
void | exchange (int i, int j) |
exchange 2 More... | |
static void | exchange_contents (EST_Litem *a, EST_Litem *b) |
exchange 3 More... | |
General functions | |
std::ostream & | operator<< (std::ostream &st, EST_TList< T > const &list) |
print list More... | |
EST_TList< T > & | operator= (const EST_TList< T > &a) |
make full copy of list More... | |
EST_TList< T > & | operator+= (const EST_TList< T > &a) |
Add list onto end of existing list. More... | |
void | clear (void) |
remove all items in list More... | |
Additional Inherited Members | |
Protected Attributes inherited from EST_UList | |
EST_UItem * | h |
EST_UItem * | t |
A Template doubly linked list class. This class contains doubly linked lists of a type denoted by T
. A pointer of type EST_Litem is used to access items in the list. The class supports a variety of ways of adding, removing and accessing items in the list. For examples of how to operate lists, see list_example.
Iteration through the list is performed using a pointer of type EST_Litem. See Iteration for example code.
Definition at line 61 of file EST_TList.h.
Definition at line 266 of file EST_TList.h.
typedef EST_TIterator< EST_TList<T>, IPointer, T > EST_TList< T >::Entries |
Definition at line 267 of file EST_TList.h.
typedef EST_TRwIterator< EST_TList<T>, IPointer, T > EST_TList< T >::RwEntries |
Definition at line 268 of file EST_TList.h.
default constructor
Definition at line 125 of file EST_TList.h.
copy constructor
Definition at line 92 of file EST_TList.cc.
Definition at line 128 of file EST_TList.h.
|
inline |
Definition at line 119 of file EST_TList.h.
Definition at line 88 of file EST_TList.cc.
return the value associated with the EST_Litem pointer. This has the same functionality as the overloaded () operator.
Definition at line 139 of file EST_TList.h.
return a const value associated with the EST_Litem pointer.
Definition at line 142 of file EST_TList.h.
return the Nth value
Definition at line 145 of file EST_TList.h.
return a const Nth value
Definition at line 148 of file EST_TList.h.
|
inline |
return const reference to first item in list
Definition at line 152 of file EST_TList.h.
|
inline |
return const reference to last item in list
Definition at line 155 of file EST_TList.h.
|
inline |
|
inline |
return reference to last item in list
Definition at line 163 of file EST_TList.h.
return const reference to item in list pointed to by ptr
Definition at line 167 of file EST_TList.h.
return non-const reference to item in list pointed to by ptr
Definition at line 170 of file EST_TList.h.
remove item pointed to by ptr
, return pointer to previous item. See Removing for example code.
Definition at line 180 of file EST_TList.h.
remove nth item, return pointer to previous item
Definition at line 184 of file EST_TList.h.
|
inline |
add item onto end of list
Definition at line 196 of file EST_TList.h.
|
inline |
add item onto start of list
Definition at line 199 of file EST_TList.h.
|
inline |
add item
after position given by ptr
, return pointer to added item.
Definition at line 205 of file EST_TList.h.
|
inline |
add item
before position given by ptr
, return pointer to added item.
Definition at line 211 of file EST_TList.h.
exchange 1
Definition at line 219 of file EST_TList.h.
exchange 2
Definition at line 222 of file EST_TList.h.
exchange 3
Definition at line 98 of file EST_TList.cc.
make full copy of list
Definition at line 113 of file EST_TList.cc.
Add list onto end of existing list.
Definition at line 121 of file EST_TList.cc.
|
inline |
remove all items in list
Definition at line 244 of file EST_TList.h.
Definition at line 257 of file EST_TList.h.
Definition at line 258 of file EST_TList.h.
|
inlineprotected |
Definition at line 259 of file EST_TList.h.
Definition at line 260 of file EST_TList.h.
|
friend |
Definition at line 262 of file EST_TList.h.
|
friend |
Definition at line 263 of file EST_TList.h.
|
friend |
print list
Definition at line 236 of file EST_TList.h.