Edinburgh Speech Tools  2.4-release
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends Pages
EST_TList< T > Class Template Reference

#include <include/EST_TList.h>

Inheritance diagram for EST_TList< T >:
Collaboration diagram for EST_TList< T >:

Classes

struct  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
 
 EST_TList (const EST_TList< T > &l)
 copy constructor
 
 ~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
 
const T & nth (int n) const
 return a const Nth value
 
const T & first () const
 return const reference to first item in list
 
const T & last () const
 return const reference to last item in list
 
T & first ()
 
T & last ()
 return reference to last item in list
 
const T & operator() (const EST_Litem *ptr) const
 return const reference to item in list pointed to by { ptr}
 
T & operator() (const EST_Litem *ptr)
 return non-const reference to item in list pointed to by { ptr}
 
Removing items in a list.

more.

EST_Litemremove (EST_Litem *ptr)
 
EST_Litemremove_nth (int n)
 remove nth item, return pointer to previous item
 
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
 
void prepend (const T &item)
 add item onto start of list
 
EST_Liteminsert_after (EST_Litem *ptr, const T &item)
 
EST_Liteminsert_before (EST_Litem *ptr, const T &item)
 
- Public Member Functions inherited from EST_UList
EST_UItemnth_pointer (int n) const
 
EST_UIteminsert_after (EST_UItem *ptr, EST_UItem *new_item)
 
EST_UIteminsert_before (EST_UItem *ptr, EST_UItem *new_item)
 
EST_UItemremove (EST_UItem *ptr, void(*item_free)(EST_UItem *item))
 
EST_UItemremove (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_UItemhead () const
 
EST_UItemtail () 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
 
void exchange (int i, int j)
 exchange 2
 
static void exchange_contents (EST_Litem *a, EST_Litem *b)
 exchange 3
 

General functions

ostream & operator<< (ostream &st, EST_TList< T > const &list)
 print list
 
EST_TList< T > & operator= (const EST_TList< T > &a)
 make full copy of list
 
EST_TList< T > & operator+= (const EST_TList< T > &a)
 Add list onto end of existing list.
 
void clear (void)
 remove all items in list
 

Additional Inherited Members

- Protected Attributes inherited from EST_UList
EST_UItemh
 
EST_UItemt
 

Detailed Description

template<class T>
class EST_TList< 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 59 of file EST_TList.h.

Member Function Documentation

template<class T>
T& EST_TList< T >::item ( const EST_Litem p)
inline

return the value associated with the EST_Litem pointer. This has the same functionality as the overloaded () operator.

Definition at line 133 of file EST_TList.h.

template<class T>
const T& EST_TList< T >::item ( const EST_Litem p) const
inline

return a const value associated with the EST_Litem pointer.

Definition at line 136 of file EST_TList.h.

template<class T>
T& EST_TList< T >::first ( )
inline

return reference to first item in list

See Also
last

Definition at line 154 of file EST_TList.h.

template<class T>
EST_Litem* EST_TList< T >::remove ( EST_Litem ptr)
inline
 remove item pointed to by {\tt ptr}, return pointer to previous item.

See {Removing} for example code.

Definition at line 175 of file EST_TList.h.

template<class T>
EST_Litem* EST_TList< T >::insert_after ( EST_Litem ptr,
const T &  item 
)
inline

add { item} after position given by { ptr}, return pointer to added item.

Definition at line 200 of file EST_TList.h.

template<class T>
EST_Litem* EST_TList< T >::insert_before ( EST_Litem ptr,
const T &  item 
)
inline

add { item} before position given by { ptr}, return pointer to added item.

Definition at line 206 of file EST_TList.h.


The documentation for this class was generated from the following files: