In file ../include/EST_TList.h:

template<class T> class EST_TList


Inheritance:


Public Methods

[more] Constructor functions

[more] EST_TList ()
default constructor
[more] EST_TList (const EST_TList<T> &l)
copy constructor

[more] Access functions for reading and writing items.

[more]T& item (const EST_Litem* p)
return the value associated with the EST_Litem pointer.
[more]const T& item (const EST_Litem* p) const
return a const value associated with the EST_Litem pointer
[more]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 ()
return reference to first item in list
[more]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 const reference to item in list pointed to by ptr

[more] Removing items in a list.

[more]EST_Litem* remove (EST_Litem* ptr)
remove item pointed to by ptr, return pointer to previous item.
[more]EST_Litem* remove_nth (int n)
remove nth item, return pointer to previous item

[more] Adding items to a list.

[more]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)
add item after position given by ptr, return pointer to added item.
[more]EST_Litem* insert_before (EST_Litem* ptr, const T &item)
add item before position given by ptr, return pointer to added item.

[more] Exchange

[more]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

[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


Documentation

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.

o Constructor functions

o EST_TList()
default constructor

o EST_TList(const EST_TList<T> &l)
copy constructor

o Access functions for reading and writing items.
See EST_TList_Accessing for examples.

oT& item(const EST_Litem* p)
return the value associated with the EST_Litem pointer. This has the same functionality as the overloaded () operator.

oconst T& item(const EST_Litem* p) const
return a const value associated with the EST_Litem pointer

oT& nth(int n)
return the Nth value

oconst T& nth(int n) const
return a const Nth value

oconst T& first() const
return const reference to first item in list

oconst T& last() const
return const reference to last item in list

oT& first()
return reference to first item in list
See Also:
last

oT& last()
return reference to last item in list

oconst T& operator () (const EST_Litem* ptr) const
return const reference to item in list pointed to by ptr

oT& operator () (const EST_Litem* ptr)
return const reference to item in list pointed to by ptr

o Removing items in a list.
more.

oEST_Litem* remove(EST_Litem* ptr)
remove item pointed to by ptr, return pointer to previous item. See Removing for example code.

oEST_Litem* remove_nth(int n)
remove nth item, return pointer to previous item

o 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.

ovoid append(const T &item)
add item onto end of list

ovoid prepend(const T &item)
add item onto start of list

oEST_Litem* insert_after(EST_Litem* ptr, const T &item)
add item after position given by ptr, return pointer to added item.

oEST_Litem* insert_before(EST_Litem* ptr, const T &item)
add item before position given by ptr, return pointer to added item.

o Exchange

ovoid exchange(EST_Litem* a, EST_Litem* b)
exchange 1

ovoid exchange(int i, int j)
exchange 2

ostatic void exchange_contents(EST_Litem* a, EST_Litem* b)
exchange 3

o General functions
Friends:
ostream& operator << (ostream &st, EST_TList<T> const &list)

oEST_TList<T> & operator=(const EST_TList<T> &a)
make full copy of list

oEST_TList<T> & operator +=(const EST_TList<T> &a)
Add list onto end of existing list

ovoid clear(void)
remove all items in list


This class has no child classes.
Friends:
class EST_TIterator< EST_TList<T>, IPointer, T >
class EST_TRwIterator< EST_TList<T>, IPointer, T >

Alphabetic index HTML hierarchy of classes or Java


This page is part of the Edinburgh Speech Tools Library documentation
Copyright University of Edinburgh 1997
Contact: speech_tools@cstr.ed.ac.uk