Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

vector Class Template Reference

#include <stl_vector.h>

Inheritance diagram for vector:

Inheritance graph
[legend]
List of all members.

Public Types

typedef T value_type
typedef value_typepointer
typedef const value_typeconst_pointer
typedef value_typeiterator
typedef const value_typeconst_iterator
typedef value_typereference
typedef const value_typeconst_reference
typedef size_t size_type
typedef ptrdiff_t difference_type
typedef reverse_iterator<
const_iterator, value_type,
const_reference, difference_type
const_reverse_iterator
typedef reverse_iterator<
iterator, value_type, reference,
difference_type
reverse_iterator

Public Methods

iterator begin ()
const_iterator begin () const
iterator end ()
const_iterator end () const
reverse_iterator rbegin ()
const_reverse_iterator rbegin () const
reverse_iterator rend ()
const_reverse_iterator rend () const
size_type size () const
size_type max_size () const
size_type capacity () const
bool empty () const
reference operator[] (size_type n)
const_reference operator[] (size_type n) const
 vector ()
 vector (size_type n, const T &value)
 vector (int n, const T &value)
 vector (long n, const T &value)
 vector (size_type n)
 vector (const vector< T, Alloc > &x)
 vector (const_iterator first, const_iterator last)
 ~vector ()
vector< T, Alloc > & operator= (const vector< T, Alloc > &x)
void reserve (size_type n)
reference front ()
const_reference front () const
reference back ()
const_reference back () const
void push_back (const T &x)
void swap (vector< T, Alloc > &x)
iterator insert (iterator position, const T &x)
iterator insert (iterator position)
void insert (iterator position, const_iterator first, const_iterator last)
void insert (iterator pos, size_type n, const T &x)
void insert (iterator pos, int n, const T &x)
void insert (iterator pos, long n, const T &x)
void pop_back ()
iterator erase (iterator position)
iterator erase (iterator first, iterator last)
void resize (size_type new_size, const T &x)
void resize (size_type new_size)
void clear ()

Protected Types

typedef simple_alloc< value_type,
Alloc > 
data_allocator

Protected Methods

void insert_aux (iterator position, const T &x)
void deallocate ()
void fill_initialize (size_type n, const T &value)
iterator allocate_and_fill (size_type n, const T &x)
iterator allocate_and_copy (size_type n, const_iterator first, const_iterator last)

Protected Attributes

iterator start
iterator finish
iterator end_of_storage

template<class T, class Alloc = alloc>
class vector< T, Alloc >


Member Typedef Documentation

template<class T, class Alloc = alloc>
typedef const value_type* vector::const_iterator
 

Definition at line 47 of file stl_vector.h.

Referenced by bit_vector::capacity.

template<class T, class Alloc = alloc>
typedef const value_type* vector::const_pointer
 

Definition at line 45 of file stl_vector.h.

template<class T, class Alloc = alloc>
typedef const value_type& vector::const_reference
 

Definition at line 49 of file stl_vector.h.

template<class T, class Alloc = alloc>
typedef reverse_iterator<const_iterator, value_type, const_reference, difference_type> vector::const_reverse_iterator
 

Definition at line 58 of file stl_vector.h.

Referenced by vector< node *, Alloc >::rbegin, bit_vector::rbegin, vector< node *, Alloc >::rend, and bit_vector::rend.

template<class T, class Alloc = alloc>
typedef simple_alloc<value_type, Alloc> vector::data_allocator [protected]
 

Definition at line 63 of file stl_vector.h.

template<class T, class Alloc = alloc>
typedef ptrdiff_t vector::difference_type
 

Definition at line 51 of file stl_vector.h.

Referenced by bit_vector::initialize, bit_vector::insert, bit_vector::operator=, bit_vector::operator[], and bit_vector::resize.

template<class T, class Alloc = alloc>
typedef value_type* vector::iterator
 

Definition at line 46 of file stl_vector.h.

Referenced by vector< node *, Alloc >::allocate_and_copy, vector< node *, Alloc >::allocate_and_fill, vector< node *, Alloc >::begin, vector< node *, Alloc >::end, vector< node *, Alloc >::erase, bit_vector::initialize, insert, vector< node *, Alloc >::insert, bit_vector::insert, insert_aux, bit_vector::insert_aux, operator=, vector< node *, Alloc >::reserve, and bit_vector::reserve.

template<class T, class Alloc = alloc>
typedef value_type* vector::pointer
 

Definition at line 44 of file stl_vector.h.

template<class T, class Alloc = alloc>
typedef value_type& vector::reference
 

Definition at line 48 of file stl_vector.h.

Referenced by vector< node *, Alloc >::back, vector< node *, Alloc >::front, and vector< node *, Alloc >::operator[].

template<class T, class Alloc = alloc>
typedef reverse_iterator<iterator, value_type, reference, difference_type> vector::reverse_iterator
 

Definition at line 60 of file stl_vector.h.

Referenced by vector< node *, Alloc >::rbegin, bit_vector::rbegin, vector< node *, Alloc >::rend, and bit_vector::rend.

template<class T, class Alloc = alloc>
typedef size_t vector::size_type
 

Definition at line 50 of file stl_vector.h.

Referenced by bit_vector::__BVECTOR, vector< node *, Alloc >::allocate_and_copy, vector< node *, Alloc >::allocate_and_fill, bit_vector::bit_alloc, vector< node *, Alloc >::capacity, bit_vector::capacity, vector< node *, Alloc >::fill_initialize, bit_vector::initialize, insert, vector< node *, Alloc >::insert, bit_vector::insert, insert_aux, bit_vector::insert_aux, vector< node *, Alloc >::max_size, bit_vector::max_size, vector< node *, Alloc >::operator[], bit_vector::operator[], vector< node *, Alloc >::reserve, bit_vector::reserve, vector< node *, Alloc >::resize, bit_vector::resize, vector< node *, Alloc >::size, bit_vector::size, and vector< node *, Alloc >::vector.

template<class T, class Alloc = alloc>
typedef T vector::value_type
 

Definition at line 43 of file stl_vector.h.


Constructor & Destructor Documentation

template<class T, class Alloc = alloc>
vector< T, Alloc >::vector   [inline]
 

Definition at line 97 of file stl_vector.h.

00097 : start(0), finish(0), end_of_storage(0) {}

template<class T, class Alloc = alloc>
vector< T, Alloc >::vector size_type    n,
const T &    value
[inline]
 

Definition at line 98 of file stl_vector.h.

00098 { fill_initialize(n, value); }

template<class T, class Alloc = alloc>
vector< T, Alloc >::vector int    n,
const T &    value
[inline]
 

Definition at line 99 of file stl_vector.h.

00099 { fill_initialize(n, value); }

template<class T, class Alloc = alloc>
vector< T, Alloc >::vector long    n,
const T &    value
[inline]
 

Definition at line 100 of file stl_vector.h.

00100 { fill_initialize(n, value); }

template<class T, class Alloc = alloc>
vector< T, Alloc >::vector size_type    n [inline, explicit]
 

Definition at line 101 of file stl_vector.h.

00101 { fill_initialize(n, T()); }

template<class T, class Alloc = alloc>
vector< T, Alloc >::vector const vector< T, Alloc > &    x [inline]
 

Definition at line 103 of file stl_vector.h.

00103                                     {
00104     start = allocate_and_copy(x.end() - x.begin(), x.begin(), x.end());
00105     finish = start + (x.end() - x.begin());
00106     end_of_storage = finish;
00107   }

template<class T, class Alloc = alloc>
vector< T, Alloc >::vector const_iterator    first,
const_iterator    last
[inline]
 

Definition at line 116 of file stl_vector.h.

00116                                                     {
00117     size_type n = 0;
00118     distance(first, last, n);
00119     start = allocate_and_copy(n, first, last);
00120     finish = start + n;
00121     end_of_storage = finish;
00122   }

template<class T, class Alloc = alloc>
vector< T, Alloc >::~vector   [inline]
 

Definition at line 124 of file stl_vector.h.

00124             { 
00125     destroy(start, finish);
00126     deallocate();
00127   }


Member Function Documentation

template<class T, class Alloc = alloc>
iterator vector< T, Alloc >::allocate_and_copy size_type    n,
const_iterator    first,
const_iterator    last
[inline, protected]
 

Definition at line 234 of file stl_vector.h.

Referenced by operator=, vector< node *, Alloc >::reserve, and vector< node *, Alloc >::vector.

00235                                                                         {
00236     iterator result = data_allocator::allocate(n);
00237     __STL_TRY {
00238       uninitialized_copy(first, last, result);
00239       return result;
00240     }
00241     __STL_UNWIND(data_allocator::deallocate(result, n));
00242   }

template<class T, class Alloc = alloc>
iterator vector< T, Alloc >::allocate_and_fill size_type    n,
const T &    x
[inline, protected]
 

Definition at line 213 of file stl_vector.h.

Referenced by vector< node *, Alloc >::fill_initialize.

00213                                                       {
00214     iterator result = data_allocator::allocate(n);
00215     __STL_TRY {
00216       uninitialized_fill_n(result, n, x);
00217       return result;
00218     }
00219     __STL_UNWIND(data_allocator::deallocate(result, n));
00220   }

template<class T, class Alloc = alloc>
const_reference vector< T, Alloc >::back   const [inline]
 

Definition at line 143 of file stl_vector.h.

00143 { return *(end() - 1); }

template<class T, class Alloc = alloc>
reference vector< T, Alloc >::back   [inline]
 

Definition at line 142 of file stl_vector.h.

00142 { return *(end() - 1); }

template<class T, class Alloc = alloc>
const_iterator vector< T, Alloc >::begin   const [inline]
 

Definition at line 79 of file stl_vector.h.

00079 { return start; }

template<class T, class Alloc = alloc>
iterator vector< T, Alloc >::begin   [inline]
 

Definition at line 78 of file stl_vector.h.

Referenced by vector< node *, Alloc >::capacity, bit_vector::capacity, vector< node *, Alloc >::clear, bit_vector::clear, vector< node *, Alloc >::empty, bit_vector::empty, vector< node *, Alloc >::front, bit_vector::front, vector< node *, Alloc >::insert, bit_vector::insert, insert_aux, bit_vector::insert_aux, operator=, bit_vector::operator=, operator==, vector< node *, Alloc >::operator[], bit_vector::operator[], vector< node *, Alloc >::rend, bit_vector::rend, bit_vector::reserve, vector< node *, Alloc >::resize, bit_vector::resize, vector< node *, Alloc >::size, bit_vector::size, and vector< node *, Alloc >::vector.

00078 { return start; }

template<class T, class Alloc = alloc>
size_type vector< T, Alloc >::capacity   const [inline]
 

Definition at line 92 of file stl_vector.h.

Referenced by bit_vector::insert, operator=, bit_vector::operator=, vector< node *, Alloc >::reserve, and bit_vector::reserve.

00092 { return size_type(end_of_storage - begin()); }

template<class T, class Alloc = alloc>
void vector< T, Alloc >::clear   [inline]
 

Definition at line 210 of file stl_vector.h.

Referenced by hashtable::copy_from.

00210 { erase(begin(), end()); }

template<class T, class Alloc = alloc>
void vector< T, Alloc >::deallocate   [inline, protected]
 

Definition at line 68 of file stl_vector.h.

Referenced by insert, bit_vector::insert, insert_aux, bit_vector::insert_aux, operator=, bit_vector::operator=, vector< node *, Alloc >::reserve, bit_vector::reserve, bit_vector::~__BVECTOR, and vector< node *, Alloc >::~vector.

00068                     {
00069     if (start) data_allocator::deallocate(start, end_of_storage - start);
00070   }

template<class T, class Alloc = alloc>
bool vector< T, Alloc >::empty   const [inline]
 

Definition at line 93 of file stl_vector.h.

00093 { return begin() == end(); }

template<class T, class Alloc = alloc>
const_iterator vector< T, Alloc >::end   const [inline]
 

Definition at line 81 of file stl_vector.h.

00081 { return finish; }

template<class T, class Alloc = alloc>
iterator vector< T, Alloc >::end   [inline]
 

Definition at line 80 of file stl_vector.h.

Referenced by vector< node *, Alloc >::back, bit_vector::back, vector< node *, Alloc >::clear, bit_vector::clear, hashtable::copy_from, vector< node *, Alloc >::empty, bit_vector::empty, vector< node *, Alloc >::erase, bit_vector::erase, hashtable< Value, Value, HashFcn, identity< Value >, EqualKey, Alloc >::initialize_buckets, vector< node *, Alloc >::insert, bit_vector::insert, insert_aux, bit_vector::insert_aux, operator=, operator==, vector< node *, Alloc >::push_back, bit_vector::push_back, vector< node *, Alloc >::rbegin, bit_vector::rbegin, bit_vector::reserve, vector< node *, Alloc >::resize, bit_vector::resize, vector< node *, Alloc >::size, bit_vector::size, and vector< node *, Alloc >::vector.

00080 { return finish; }

template<class T, class Alloc = alloc>
iterator vector< T, Alloc >::erase iterator    first,
iterator    last
[inline]
 

Definition at line 197 of file stl_vector.h.

00197                                                 {
00198     iterator i = copy(last, finish, first);
00199     destroy(i, finish);
00200     finish = finish - (last - first);
00201     return first;
00202   }

template<class T, class Alloc = alloc>
iterator vector< T, Alloc >::erase iterator    position [inline]
 

Definition at line 190 of file stl_vector.h.

Referenced by vector< node *, Alloc >::clear, bit_vector::clear, vector< node *, Alloc >::resize, and bit_vector::resize.

00190                                     {
00191     if (position + 1 != end())
00192       copy(position + 1, finish, position);
00193     --finish;
00194     destroy(finish);
00195     return position;
00196   }

template<class T, class Alloc = alloc>
void vector< T, Alloc >::fill_initialize size_type    n,
const T &    value
[inline, protected]
 

Definition at line 72 of file stl_vector.h.

Referenced by vector< node *, Alloc >::vector.

00072                                                     {
00073     start = allocate_and_fill(n, value);
00074     finish = start + n;
00075     end_of_storage = finish;
00076   }

template<class T, class Alloc = alloc>
const_reference vector< T, Alloc >::front   const [inline]
 

Definition at line 141 of file stl_vector.h.

00141 { return *begin(); }

template<class T, class Alloc = alloc>
reference vector< T, Alloc >::front   [inline]
 

Definition at line 140 of file stl_vector.h.

00140 { return *begin(); }

template<class T, class Alloc = alloc>
void vector< T, Alloc >::insert iterator    pos,
long    n,
const T &    x
[inline]
 

Definition at line 182 of file stl_vector.h.

00182                                                  {
00183     insert(pos, (size_type) n, x);
00184   }

template<class T, class Alloc = alloc>
void vector< T, Alloc >::insert iterator    pos,
int    n,
const T &    x
[inline]
 

Definition at line 179 of file stl_vector.h.

00179                                                 {
00180     insert(pos, (size_type) n, x);
00181   }

template<class T, class Alloc>
void vector< T, Alloc >::insert iterator    pos,
size_type    n,
const T &    x
 

Definition at line 359 of file stl_vector.h.

References __STL_TRY, copy_backward, deallocate, destroy, end_of_storage, fill, finish, iterator, max, size, size_type, start, uninitialized_copy, and uninitialized_fill_n.

00359                                                                         {
00360   if (n != 0) {
00361     if (size_type(end_of_storage - finish) >= n) {
00362       T x_copy = x;
00363       const size_type elems_after = finish - position;
00364       iterator old_finish = finish;
00365       if (elems_after > n) {
00366         uninitialized_copy(finish - n, finish, finish);
00367         finish += n;
00368         copy_backward(position, old_finish - n, old_finish);
00369         fill(position, position + n, x_copy);
00370       }
00371       else {
00372         uninitialized_fill_n(finish, n - elems_after, x_copy);
00373         finish += n - elems_after;
00374         uninitialized_copy(position, old_finish, finish);
00375         finish += elems_after;
00376         fill(position, old_finish, x_copy);
00377       }
00378     }
00379     else {
00380       const size_type old_size = size();        
00381       const size_type len = old_size + max(old_size, n);
00382       iterator new_start = data_allocator::allocate(len);
00383       iterator new_finish = new_start;
00384       __STL_TRY {
00385         new_finish = uninitialized_copy(start, position, new_start);
00386         new_finish = uninitialized_fill_n(new_finish, n, x);
00387         new_finish = uninitialized_copy(position, finish, new_finish);
00388       }
00389 #         ifdef  __STL_USE_EXCEPTIONS 
00390       catch(...) {
00391         destroy(new_start, new_finish);
00392         data_allocator::deallocate(new_start, len);
00393         throw;
00394       }
00395 #         endif /* __STL_USE_EXCEPTIONS */
00396       destroy(start, finish);
00397       deallocate();
00398       start = new_start;
00399       finish = new_finish;
00400       end_of_storage = new_start + len;
00401     }
00402   }
00403 }

template<class T, class Alloc>
void vector< T, Alloc >::insert iterator    position,
const_iterator    first,
const_iterator    last
 

Definition at line 473 of file stl_vector.h.

References __STL_TRY, copy, copy_backward, deallocate, destroy, distance, end_of_storage, finish, iterator, max, size, size_type, start, and uninitialized_copy.

00475                                                    {
00476   if (first != last) {
00477     size_type n = 0;
00478     distance(first, last, n);
00479     if (size_type(end_of_storage - finish) >= n) {
00480       const size_type elems_after = finish - position;
00481       iterator old_finish = finish;
00482       if (elems_after > n) {
00483         uninitialized_copy(finish - n, finish, finish);
00484         finish += n;
00485         copy_backward(position, old_finish - n, old_finish);
00486         copy(first, last, position);
00487       }
00488       else {
00489         uninitialized_copy(first + elems_after, last, finish);
00490         finish += n - elems_after;
00491         uninitialized_copy(position, old_finish, finish);
00492         finish += elems_after;
00493         copy(first, first + elems_after, position);
00494       }
00495     }
00496     else {
00497       const size_type old_size = size();
00498       const size_type len = old_size + max(old_size, n);
00499       iterator new_start = data_allocator::allocate(len);
00500       iterator new_finish = new_start;
00501       __STL_TRY {
00502         new_finish = uninitialized_copy(start, position, new_start);
00503         new_finish = uninitialized_copy(first, last, new_finish);
00504         new_finish = uninitialized_copy(position, finish, new_finish);
00505       }
00506 #         ifdef __STL_USE_EXCEPTIONS
00507       catch(...) {
00508         destroy(new_start, new_finish);
00509         data_allocator::deallocate(new_start, len);
00510         throw;
00511       }
00512 #         endif /* __STL_USE_EXCEPTIONS */
00513       destroy(start, finish);
00514       deallocate();
00515       start = new_start;
00516       finish = new_finish;
00517       end_of_storage = new_start + len;
00518     }
00519   }
00520 }

template<class T, class Alloc = alloc>
iterator vector< T, Alloc >::insert iterator    position [inline]
 

Definition at line 167 of file stl_vector.h.

00167 { return insert(position, T()); }

template<class T, class Alloc = alloc>
iterator vector< T, Alloc >::insert iterator    position,
const T &    x
[inline]
 

Definition at line 157 of file stl_vector.h.

Referenced by hashtable::copy_from, hashtable< Value, Value, HashFcn, identity< Value >, EqualKey, Alloc >::initialize_buckets, vector< node *, Alloc >::insert, bit_vector::insert, vector< node *, Alloc >::resize, and bit_vector::resize.

00157                                                  {
00158     size_type n = position - begin();
00159     if (finish != end_of_storage && position == end()) {
00160       construct(finish, x);
00161       ++finish;
00162     }
00163     else
00164       insert_aux(position, x);
00165     return begin() + n;
00166   }

template<class T, class Alloc>
void vector< T, Alloc >::insert_aux iterator    position,
const T &    x
[protected]
 

Definition at line 323 of file stl_vector.h.

References __STL_TRY, begin, construct, copy_backward, deallocate, destroy, end, end_of_storage, finish, iterator, size, size_type, start, and uninitialized_copy.

Referenced by vector< node *, Alloc >::insert, bit_vector::insert, vector< node *, Alloc >::push_back, and bit_vector::push_back.

00323                                                                {
00324   if (finish != end_of_storage) {
00325     construct(finish, *(finish - 1));
00326     ++finish;
00327     T x_copy = x;
00328     copy_backward(position, finish - 2, finish - 1);
00329     *position = x_copy;
00330   }
00331   else {
00332     const size_type old_size = size();
00333     const size_type len = old_size != 0 ? 2 * old_size : 1;
00334     iterator new_start = data_allocator::allocate(len);
00335     iterator new_finish = new_start;
00336     __STL_TRY {
00337       new_finish = uninitialized_copy(start, position, new_start);
00338       construct(new_finish, x);
00339       ++new_finish;
00340       new_finish = uninitialized_copy(position, finish, new_finish);
00341     }
00342 
00343 #       ifdef  __STL_USE_EXCEPTIONS 
00344     catch(...) {
00345       destroy(new_start, new_finish); 
00346       data_allocator::deallocate(new_start, len);
00347       throw;
00348     }
00349 #       endif /* __STL_USE_EXCEPTIONS */
00350     destroy(begin(), end());
00351     deallocate();
00352     start = new_start;
00353     finish = new_finish;
00354     end_of_storage = new_start + len;
00355   }
00356 }

template<class T, class Alloc = alloc>
size_type vector< T, Alloc >::max_size   const [inline]
 

Definition at line 91 of file stl_vector.h.

00091 { return size_type(-1) / sizeof(T); }

template<class T, class Alloc>
vector< T, Alloc > & vector< T, Alloc >::operator= const vector< T, Alloc > &    x
 

Definition at line 299 of file stl_vector.h.

References allocate_and_copy, begin, capacity, copy, deallocate, destroy, end, end_of_storage, finish, iterator, size, start, and uninitialized_copy.

00299                                                                        {
00300   if (&x != this) {
00301     if (x.size() > capacity()) {
00302       iterator tmp = allocate_and_copy(x.end() - x.begin(),
00303                                        x.begin(), x.end());
00304       destroy(start, finish);
00305       deallocate();
00306       start = tmp;
00307       end_of_storage = start + (x.end() - x.begin());
00308     }
00309     else if (size() >= x.size()) {
00310       iterator i = copy(x.begin(), x.end(), begin());
00311       destroy(i, finish);
00312     }
00313     else {
00314       copy(x.begin(), x.begin() + size(), start);
00315       uninitialized_copy(x.begin() + size(), x.end(), finish);
00316     }
00317     finish = start + x.size();
00318   }
00319   return *this;
00320 }

template<class T, class Alloc = alloc>
const_reference vector< T, Alloc >::operator[] size_type    n const [inline]
 

Definition at line 95 of file stl_vector.h.

00095 { return *(begin() + n); }

template<class T, class Alloc = alloc>
reference vector< T, Alloc >::operator[] size_type    n [inline]
 

Definition at line 94 of file stl_vector.h.

00094 { return *(begin() + n); }

template<class T, class Alloc = alloc>
void vector< T, Alloc >::pop_back   [inline]
 

Definition at line 186 of file stl_vector.h.

00186                   {
00187     --finish;
00188     destroy(finish);
00189   }

template<class T, class Alloc = alloc>
void vector< T, Alloc >::push_back const T &    x [inline]
 

Definition at line 144 of file stl_vector.h.

00144                              {
00145     if (finish != end_of_storage) {
00146       construct(finish, x);
00147       ++finish;
00148     }
00149     else
00150       insert_aux(end(), x);
00151   }

template<class T, class Alloc = alloc>
const_reverse_iterator vector< T, Alloc >::rbegin   const [inline]
 

Definition at line 83 of file stl_vector.h.

00083                                         { 
00084     return const_reverse_iterator(end()); 
00085   }

template<class T, class Alloc = alloc>
reverse_iterator vector< T, Alloc >::rbegin   [inline]
 

Definition at line 82 of file stl_vector.h.

00082 { return reverse_iterator(end()); }

template<class T, class Alloc = alloc>
const_reverse_iterator vector< T, Alloc >::rend   const [inline]
 

Definition at line 87 of file stl_vector.h.

00087                                       { 
00088     return const_reverse_iterator(begin()); 
00089   }

template<class T, class Alloc = alloc>
reverse_iterator vector< T, Alloc >::rend   [inline]
 

Definition at line 86 of file stl_vector.h.

00086 { return reverse_iterator(begin()); }

template<class T, class Alloc = alloc>
void vector< T, Alloc >::reserve size_type    n [inline]
 

Definition at line 129 of file stl_vector.h.

Referenced by hashtable::copy_from, and hashtable< Value, Value, HashFcn, identity< Value >, EqualKey, Alloc >::initialize_buckets.

00129                             {
00130     if (capacity() < n) {
00131       const size_type old_size = size();
00132       iterator tmp = allocate_and_copy(n, start, finish);
00133       destroy(start, finish);
00134       deallocate();
00135       start = tmp;
00136       finish = tmp + old_size;
00137       end_of_storage = start + n;
00138     }
00139   }

template<class T, class Alloc = alloc>
void vector< T, Alloc >::resize size_type    new_size [inline]
 

Definition at line 209 of file stl_vector.h.

00209 { resize(new_size, T()); }

template<class T, class Alloc = alloc>
void vector< T, Alloc >::resize size_type    new_size,
const T &    x
[inline]
 

Definition at line 203 of file stl_vector.h.

Referenced by vector< node *, Alloc >::resize.

00203                                               {
00204     if (new_size < size()) 
00205       erase(begin() + new_size, end());
00206     else
00207       insert(end(), new_size - size(), x);
00208   }

template<class T, class Alloc = alloc>
size_type vector< T, Alloc >::size   const [inline]
 

Definition at line 90 of file stl_vector.h.

Referenced by hashtable< Value, Value, HashFcn, identity< Value >, EqualKey, Alloc >::begin, hashtable< Value, Value, HashFcn, identity< Value >, EqualKey, Alloc >::bkt_num_key, hashtable< Value, Value, HashFcn, identity< Value >, EqualKey, Alloc >::bucket_count, hashtable::clear, hashtable::erase, insert, bit_vector::insert, insert_aux, bit_vector::insert_aux, operator=, operator==, vector< node *, Alloc >::reserve, vector< node *, Alloc >::resize, hashtable::resize, and bit_vector::resize.

00090 { return size_type(end() - begin()); }

template<class T, class Alloc = alloc>
void vector< T, Alloc >::swap vector< T, Alloc > &    x [inline]
 

Definition at line 152 of file stl_vector.h.

Referenced by hashtable::resize, and hashtable< Value, Value, HashFcn, identity< Value >, EqualKey, Alloc >::swap.

00152                                  {
00153     __STD::swap(start, x.start);
00154     __STD::swap(finish, x.finish);
00155     __STD::swap(end_of_storage, x.end_of_storage);
00156   }


Member Data Documentation

template<class T, class Alloc = alloc>
iterator vector::end_of_storage [protected]
 

Definition at line 66 of file stl_vector.h.

Referenced by bit_vector::__BVECTOR, vector< node *, Alloc >::capacity, bit_vector::capacity, vector< node *, Alloc >::deallocate, bit_vector::deallocate, vector< node *, Alloc >::fill_initialize, bit_vector::initialize, insert, vector< node *, Alloc >::insert, bit_vector::insert, insert_aux, bit_vector::insert_aux, operator=, vector< node *, Alloc >::push_back, bit_vector::push_back, vector< node *, Alloc >::reserve, bit_vector::reserve, vector< node *, Alloc >::swap, bit_vector::swap, and vector< node *, Alloc >::vector.

template<class T, class Alloc = alloc>
iterator vector::finish [protected]
 

Definition at line 65 of file stl_vector.h.

Referenced by vector< node *, Alloc >::end, vector< node *, Alloc >::erase, vector< node *, Alloc >::fill_initialize, insert, vector< node *, Alloc >::insert, insert_aux, operator=, vector< node *, Alloc >::pop_back, vector< node *, Alloc >::push_back, vector< node *, Alloc >::reserve, vector< node *, Alloc >::swap, vector< node *, Alloc >::vector, and vector< node *, Alloc >::~vector.

template<class T, class Alloc = alloc>
iterator vector::start [protected]
 

Definition at line 64 of file stl_vector.h.

Referenced by vector< node *, Alloc >::begin, vector< node *, Alloc >::deallocate, vector< node *, Alloc >::fill_initialize, insert, insert_aux, operator=, vector< node *, Alloc >::reserve, vector< node *, Alloc >::swap, vector< node *, Alloc >::vector, and vector< node *, Alloc >::~vector.


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

Documentation generated on Thu May 2 15:03:47 2002

Generated with doxygen 1.2.12 by Dimitri van Heesch ,   1997-2001