Main Page   Class Hierarchy   Compound List   File List   Compound Members  

TValListT< T > Class Template Reference

A template class implementing a double linked list. More...

#include <TValListT.hh>

List of all members.

Public Methods

 TValListT ()
 Constructs an empty list.

 TValListT (TValListT< T > &list)
 Copy constructor.

 ~TValListT ()
 Destructor.

void Append (T a)
 Add an element to the end of the list.

void Apply (void(*fn)(T *, void *), void *d)
 Applies the user defined function to every element in the list.

void Clear ()
 Remove all elements from the list.

int Entries () const
 Return the number of entries in the list.

First ()
 Return the first element of the list.

void Insert (T a, int i=0)
 Add an element before the specified entry.

Last ()
 Return the last element of the list.

Remove (int i=0)
 Remove element at the specified position.

RemoveLast ()
 Remove the last element of the list.

void Sort (bool reverse=false)
 Sort all entries in self with the less than operator (<).

T & operator[] (int i)
 Index operator.

TValListT< T > & operator= (const TValListT< T > &list)
 Assignment operator.


Detailed Description

template<class T>
class TValListT< T >

A template class implementing a double linked list.

Author:
Johan Bolmsjo <johan@nocrew.org>


Member Function Documentation

template<class T>
void TValListT< T >::Apply void(*    fn)(T *, void *),
void *    d
 

Applies the user defined function to every element in the list.

Parameters:
fn Function pointer to your function.
d Client data to pass to your function.

template<class T>
T TValListT< T >::First   [inline]
 

Return the first element of the list.

Null is returned if the list is empty.

template<class T>
T TValListT< T >::Last   [inline]
 

Return the last element of the list.

Null is returned if the list is empty.

template<class T>
T & TValListT< T >::operator[] int    i
 

Index operator.

Returns a reference to the object so that it may be modified.

template<class T>
void TValListT< T >::Sort bool    reverse = false
 

Sort all entries in self with the less than operator (<).

Parameters:
reverse Sort backwards if true.


The documentation for this class was generated from the following file:
Generated on Sat Feb 15 18:37:16 2003 for Tools by doxygen1.3-rc2