In file ../include/EST_TList.h:

## template<class T> class EST_TList

## Inheritance:

### Public Methods

  | Constructor functions
  | EST_TList () default constructor
  | EST_TList (const EST_TList<T> &l) copy constructor
  | Access functions for reading and writing items.
  T& | item (const EST_Litem* p) return the value associated with the EST_Litem pointer.
  const T& | item (const EST_Litem* p) const return a const value associated with the EST_Litem pointer
  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 () return reference to first item in list
  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 const reference to item in list pointed to by `ptr`
  | Removing items in a list.
  EST_Litem* | remove (EST_Litem* ptr) remove item pointed to by `ptr`, return pointer to previous item.
  EST_Litem* | remove_nth (int n) remove nth item, return pointer to previous item
  | Adding items to a list.
  void | append (const T &item) add item onto end of list
  void | prepend (const T &item) add item onto start of list
  EST_Litem* | insert_after (EST_Litem* ptr, const T &item) add `item` after position given by `ptr`, return pointer to added item.
  EST_Litem* | insert_before (EST_Litem* ptr, const T &item) add `item` before position given by `ptr`, return pointer to added item.
  | 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
  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

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

`Constructor functions`

`EST_TList()`
  default constructor

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

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

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

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

  `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()`
    return reference to first item in list
    See Also:
      last

  `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 const reference to item in list pointed to by `ptr`

`Removing items in a list.`
  more.

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

  `EST_Litem* remove_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_Litem* insert_after(EST_Litem* ptr, const T &item)`
    add `item` after position given by `ptr`, return pointer to added item.

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

`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`

Friends:
  ostream& operator << (ostream &st, EST_TList<T> const &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

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