50#include "EST_common.h"
52#include "EST_TSortable.h"
53#include "EST_TIterator.h"
55#include "instantiate/EST_TListI.h"
63 static void *
operator new(
size_t not_used,
void *place)
64 {(void)not_used;
return place;}
65 static void *
operator new(
size_t size)
67 p = (
void *)walloc(
char,size);
69 static void operator delete(
void *p)
73 static unsigned int s_nfree;
74 static unsigned int s_maxFree;
113 void init() { EST_UList::init(); };
140 {
return item(nth_pointer(n)); };
143 {
return item(nth_pointer(n)); };
147 {
return item(head()); };
150 {
return item(tail()); };
155 {
return item(head()); };
158 {
return item(tail()); };
162 {
return item(ptr); };
165 {
return item(ptr); };
176 {
return EST_UList::remove(ptr, free_item); };
180 {
return EST_UList::remove(n, free_item); };
215 { EST_UList::exchange(a, b); };
218 { EST_UList::exchange(i,j); };
233 for (ptr = list.head(); ptr != 0; ptr = ptr->next())
234 st << list.
item(ptr) <<
" ";
240 { clear_and_free(free_item); };
248 void point_to_first(
IPointer &ip)
const { ip.p = head(); }
249 void move_pointer_forwards(IPointer &ip)
const { ip.p = ip.p->next(); }
250 bool points_to_something(
const IPointer &ip)
const {
return ip.p != NULL; }
251 T &points_at(
const IPointer &ip) {
return item(ip.p); }
310 EST_UList::sort_unique(l,
319 EST_UList::merge_sort_unique(l, m,
326const char *error_name(
EST_TList<T> val) { (void)val;
return "<<TLIST>>"; }
void exchange(EST_Litem *a, EST_Litem *b)
exchange 1
EST_Litem * remove_nth(int n)
remove nth item, return pointer to previous item
const T & last() const
return const reference to last item in list
T & item(const EST_Litem *p)
friend ostream & operator<<(ostream &st, EST_TList< T > const &list)
print list
T & nth(int n)
return the Nth value
EST_TList< T > & operator=(const EST_TList< T > &a)
make full copy of list
void clear(void)
remove all items in list
void append(const T &item)
add item onto end of list
T & last()
return reference to last item in list
EST_TList()
default constructor
EST_Litem * remove(EST_Litem *ptr)
static void exchange_contents(EST_Litem *a, EST_Litem *b)
exchange 3
EST_TList< T > & operator+=(const EST_TList< T > &a)
Add list onto end of existing list.
EST_Litem * insert_after(EST_Litem *ptr, const T &item)
EST_Litem * insert_before(EST_Litem *ptr, const T &item)
void exchange(int i, int j)
exchange 2
const T & item(const EST_Litem *p) const
const T & operator()(const EST_Litem *ptr) const
return const reference to item in list pointed to by {\tt ptr}
const T & first() const
return const reference to first item in list
void prepend(const T &item)
add item onto start of list
const T & nth(int n) const
return a const Nth value