Class Hierarchy   Compound List   File List   Header Files   Compound Members   File Members  

suif_vector Class Reference

A vector class along the lines of the STL vector class but simpler. More...

#include <common/suif_vector.h>

Class diagram for suif_vector:

MethodDefList

List of all members.


Public Members

typedef T VectorType
typedef T value_type
typedef T* iterator
typedef const T* const_iterator
suif_vector ()
suif_vector (unsigned n, const T& val = T())
Create a vector. More...

suif_vector (const suif_vector<T>& vec)
~suif_vector ()
suif_vector<T>& operator= (const suif_vector<T>& vec)
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
unsigned length () const
return number of elements.

unsigned size () const
return number of elements.

bool empty () const
Is the vector empty.

unsigned capacity () const
Return available entries.

void insert (iterator pos, const T& x)
Insert a value at the given position.

void insert (int pos,const T& y)
Insert at the given position.

iterator erase (iterator pos)
Remove an element and return position of following (or end() ).

void erase (unsigned pos)
Remove entry in given position.

void push_back (const T& x)
void pop_back ()
T& operator[] (unsigned n)
Index operator.

const T& operator[] (unsigned n) const
T& at (unsigned n) const
T& front ()
T& back ()
const T& front () const
const T& back () const
bool is_member (const T& x) const
Find an item in the list This forces items to have equality defined. More...

void clear (void)
Empty the list.


Protected Members

void allocate_vector (unsigned n)
void vector_fill (iterator& start, unsigned n, const T& val)
iterator copy (const_iterator start, const_iterator end, iterator dest)
const_iterator reverse_copy (const_iterator start, const_iterator end, iterator dest)
void insert_aux (iterator pos, const T& x)
T* buff
iterator m_start
iterator m_finish
iterator m_end_of_storage

Detailed Description

template<class T> class suif_vector

A vector class along the lines of the STL vector class but simpler.

The intent is to support compilers which are unable to compile STL A vector is a list with a fast index operation but potentially slower insert and slower insert/erase at anywhere but end


Member Typedef Documentation

template<class T>
typedef T suif_vector<T>::VectorType

template<class T>
typedef T suif_vector<T>::value_type

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

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


Member Function Documentation

template<class T>
suif_vector<T>::suif_vector<T> ()

template<class T>
suif_vector<T>::suif_vector<T> (unsigned n, const T & val = T())

Create a vector.

Parameters:
Size - to create
Default - value for elements

template<class T>
suif_vector<T>::suif_vector<T> (const suif_vector<T>& vec)

template<class T>
suif_vector<T>::~suif_vector<T> ()

template<class T>
suif_vector<T>& suif_vector<T>::operator= (const suif_vector<T>& vec)

template<class T>
iterator suif_vector<T>::begin ()

template<class T>
iterator suif_vector<T>::end ()

template<class T>
const_iterator suif_vector<T>::begin () const

template<class T>
const_iterator suif_vector<T>::end () const

template<class T>
unsigned suif_vector<T>::length () const

return number of elements.

template<class T>
unsigned suif_vector<T>::size () const

return number of elements.

template<class T>
bool suif_vector<T>::empty () const

Is the vector empty.

template<class T>
unsigned suif_vector<T>::capacity () const

Return available entries.

template<class T>
void suif_vector<T>::insert (iterator pos, const T & x)

Insert a value at the given position.

template<class T>
void suif_vector<T>::insert (int pos, const T & y)

Insert at the given position.

template<class T>
iterator suif_vector<T>::erase (iterator pos)

Remove an element and return position of following (or end() ).

template<class T>
void suif_vector<T>::erase (unsigned pos)

Remove entry in given position.

template<class T>
void suif_vector<T>::push_back (const T & x)

template<class T>
void suif_vector<T>::pop_back ()

template<class T>
T & suif_vector<T>::operator[] (unsigned n)

Index operator.

template<class T>
const T & suif_vector<T>::operator[] (unsigned n) const

template<class T>
T & suif_vector<T>::at (unsigned n) const

template<class T>
T & suif_vector<T>::front ()

template<class T>
T & suif_vector<T>::back ()

template<class T>
const T & suif_vector<T>::front () const

template<class T>
const T & suif_vector<T>::back () const

template<class T>
bool suif_vector<T>::is_member (const T & x) const

Find an item in the list This forces items to have equality defined.

This should probably be removed

template<class T>
void suif_vector<T>::clear (void)

Empty the list.

template<class T>
void suif_vector<T>::allocate_vector (unsigned n) [protected]

template<class T>
void suif_vector<T>::vector_fill (iterator & start, unsigned n, const T & val) [protected]

template<class T>
iterator suif_vector<T>::copy (const_iterator start, const_iterator end, iterator dest) [protected]

template<class T>
const_iterator suif_vector<T>::reverse_copy (const_iterator start, const_iterator end, iterator dest) [protected]

template<class T>
void suif_vector<T>::insert_aux (iterator pos, const T & x) [protected]


Member Data Documentation

template<class T>
T* suif_vector<T>::buff [protected]

template<class T>
iterator suif_vector<T>::m_start [protected]

template<class T>
iterator suif_vector<T>::m_finish [protected]

template<class T>
iterator suif_vector<T>::m_end_of_storage [protected]


The documentation for this class was generated from the following file:
Generated at Wed Apr 25 17:35:23 2001 for NCI SUIF by doxygen  written by Dimitri van Heesch, © 1997-1999