tvector< T > Class Template Reference

Array class with debugging support and std::vector-compatible methods. More...

#include <tvector.h>

Inheritance diagram for tvector< T >:

gridripper::metric::MetricParam

List of all members.

Public Types

typedef T * iterator
 Iterator.
typedef const T * const_iterator
 Constant iterator.

Public Member Functions

 tvector ()
 Create an empty array.
 tvector (unsigned n)
 Create an array with n elements.
 tvector (unsigned n, const T &value)
 Create an array with n initialized elements.
 tvector (const tvector &a)
 Copy constructor.
unsigned size () const
 Gets the number of elements.
unsigned capacity () const
 Gets the capacity.
 operator T * ()
 Gets the underlying array.
 operator const T * () const
 Gets the underlying array.
tvectoroperator= (const tvector &a)
 Copy.
void clear ()
 Remove all elements and delete the underlying array.
void erase (iterator first)
 Erase an element.
void erase (iterator first, iterator last)
 Erase elements.
void erase (const T &x)
 Erase elements with the specified value.
void resize (unsigned n)
 Resize array and initialize the new elements.
void resize (unsigned n, const T &value)
 Resize array and initialize the new elements.
void insert (iterator p, const T &value)
 Insert a new element.
void insert (iterator p, const T *first, const T *last)
 Insert new elements.
void push_back (const T &value)
 Add a new element.
void pop_back ()
 Remove the last element.
T & operator[] (int k)
 Gets the kth element.
T & front ()
 Gets the kth element.
const T & front () const
 Gets the first element as a constant.
T & back ()
 Gets the last element.
const T & back () const
 Gets the last element as a constant.
iterator begin ()
 Returns an iterator to the beginning.
const_iterator begin () const
 Returns an iterator to the beginning.
iterator end ()
 Returns an iterator to end.
const_iterator end () const
 Returns an iterator to end.
void sort ()
 quicksort the contend of the vector, T must define operator <


Detailed Description

template<class T>
class tvector< T >

Array class with debugging support and std::vector-compatible methods.

Extra method: erase(T);

Version:
0.3, 02/05/2003
Author:
Peter Csizmadia (1993-95,99-2001)

Sen Cheng (2001)


Member Typedef Documentation

template<class T>
typedef T* tvector< T >::iterator

Iterator.

template<class T>
typedef const T* tvector< T >::const_iterator

Constant iterator.


Constructor & Destructor Documentation

template<class T>
tvector< T >::tvector (  )  [inline]

Create an empty array.

template<class T>
tvector< T >::tvector ( unsigned  n  )  [inline]

Create an array with n elements.

template<class T>
tvector< T >::tvector ( unsigned  n,
const T &  value 
) [inline]

Create an array with n initialized elements.

template<class T>
tvector< T >::tvector ( const tvector< T > &  a  )  [inline]

Copy constructor.


Member Function Documentation

template<class T>
unsigned tvector< T >::size (  )  const [inline]

Gets the number of elements.

template<class T>
unsigned tvector< T >::capacity (  )  const [inline]

Gets the capacity.

template<class T>
tvector< T >::operator T * (  )  [inline]

Gets the underlying array.

template<class T>
tvector< T >::operator const T * (  )  const [inline]

Gets the underlying array.

template<class T>
tvector& tvector< T >::operator= ( const tvector< T > &  a  )  [inline]

Copy.

template<class T>
void tvector< T >::clear (  )  [inline]

Remove all elements and delete the underlying array.

template<class T>
void tvector< T >::erase ( iterator  first  )  [inline]

Erase an element.

template<class T>
void tvector< T >::erase ( iterator  first,
iterator  last 
) [inline]

Erase elements.

template<class T>
void tvector< T >::erase ( const T &  x  )  [inline]

Erase elements with the specified value.

template<class T>
void tvector< T >::resize ( unsigned  n  )  [inline]

Resize array and initialize the new elements.

template<class T>
void tvector< T >::resize ( unsigned  n,
const T &  value 
) [inline]

Resize array and initialize the new elements.

template<class T>
void tvector< T >::insert ( iterator  p,
const T &  value 
) [inline]

Insert a new element.

template<class T>
void tvector< T >::insert ( iterator  p,
const T *  first,
const T *  last 
) [inline]

Insert new elements.

template<class T>
void tvector< T >::push_back ( const T &  value  )  [inline]

Add a new element.

template<class T>
void tvector< T >::pop_back (  )  [inline]

Remove the last element.

template<class T>
T& tvector< T >::operator[] ( int  k  )  [inline]

Gets the kth element.

template<class T>
T& tvector< T >::front (  )  [inline]

Gets the kth element.

Gets the first element.

template<class T>
const T& tvector< T >::front (  )  const [inline]

Gets the first element as a constant.

template<class T>
T& tvector< T >::back (  )  [inline]

Gets the last element.

template<class T>
const T& tvector< T >::back (  )  const [inline]

Gets the last element as a constant.

template<class T>
iterator tvector< T >::begin (  )  [inline]

Returns an iterator to the beginning.

template<class T>
const_iterator tvector< T >::begin (  )  const [inline]

Returns an iterator to the beginning.

template<class T>
iterator tvector< T >::end (  )  [inline]

Returns an iterator to end.

template<class T>
const_iterator tvector< T >::end (  )  const [inline]

Returns an iterator to end.


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

Generated on Wed Jun 17 18:46:47 2009 for GridRipper by  doxygen 1.5.6