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

std::safe_vector< T, Allo > Class Template Reference

#include <safe_vector.h>

Inherits std::vector< T, Allo >.

Inheritance diagram for std::safe_vector:

Inheritance graph
[legend]
Collaboration diagram for std::safe_vector< T, Allo >:

Collaboration graph
[legend]
List of all members.

Public Methods

 safe_vector (unsigned int __n, const T &val)
 safe_vector ()
 safe_vector (unsigned int __n)
 safe_vector (const vector< T, Allo > &v)
const vector< T, Allo > & operator= (const vector< T, Allo > &a)
T & operator[] (unsigned int n)
const T & operator[] (unsigned int n) const
T & at (unsigned int n)
const T & at (unsigned int n) const
void push_back (const T &t)
void push_back ()
vector< T, Allo > & operator= (const vector< T, Allo > &k)
void reserve (unsigned int n)
iterator begin ()
iterator end ()
const_iterator end () const
const_iterator begin () const
iterator erase (iterator a, iterator b)
void swap (safe_vector< T, Allo > &a)
void resize (size_type ns, const T &x)
void resize (size_type ns)
T & back ()
const T & back () const
T & front ()
const T & front () const
void clear ()
iterator erase (iterator a)
iterator insert (iterator positn, const T &t)
iterator insert (iterator positn, unsigned int n, const T &t)
iterator insert (iterator positn)
iterator insert (iterator positn, unsigned int n)

Static Private Methods

int DIE_NOW ()
int temprand ()

Private Attributes

int id

template<class T, class Allo = allocator <T>>
class std::safe_vector< T, Allo >


Constructor & Destructor Documentation

template<class T, class Allo = allocator <T>>
std::safe_vector< T, Allo >::safe_vector (  unsigned int    __n,
const T &    val
)  [inline]
 

00016                                                   :vector<T,Allo>(__n,val) {
00017     id=temprand();
00018       }

template<class T, class Allo = allocator <T>>
std::safe_vector< T, Allo >::safe_vector (    )  [inline]
 

00019                      {
00020     id=temprand();
00021       }

template<class T, class Allo = allocator <T>>
std::safe_vector< T, Allo >::safe_vector (  unsigned int    __n )  [inline]
 

00022                                     : vector<T,Allo> (__n) {
00023     id=temprand();
00024       }

template<class T, class Allo = allocator <T>>
std::safe_vector< T, Allo >::safe_vector (  const vector< T, Allo > &    v )  [inline]
 

00025                                             : vector<T,Allo>(v){
00026     id=temprand();
00027       }


Member Function Documentation

template<class T, class Allo = allocator <T>>
const T& std::safe_vector< T, Allo >::at (  unsigned int    n )  const [inline]
 

00036 {return (*((vector <T,Allo> *)this)).at(n);}

template<class T, class Allo = allocator <T>>
T& std::safe_vector< T, Allo >::at (  unsigned int    n )  [inline]
 

00035 { return (*((vector <T,Allo> *)this)).at(n); }

template<class T, class Allo = allocator <T>>
const T& std::safe_vector< T, Allo >::back (    )  const [inline]
 

00212                            {
00213       if (size()>0) return ((vector <T,Allo> *)this)->back();      
00214     }

template<class T, class Allo = allocator <T>>
T& std::safe_vector< T, Allo >::back (    )  [inline]
 

00209                {
00210       if (size()>0) return ((vector <T,Allo> *)this)->back();      
00211     }

template<class T, class Allo = allocator <T>>
const_iterator std::safe_vector< T, Allo >::begin (    )  const [inline]
 

00186                                   {
00187     return const_iterator (((const vector<T,Allo> *)this)->begin(),this);
00188       }

template<class T, class Allo = allocator <T>>
iterator std::safe_vector< T, Allo >::begin (    )  [inline]
 

00177                        {
00178     return iterator (((vector<T,Allo>*)this)->begin(),this);
00179       }

template<class T, class Allo = allocator <T>>
void std::safe_vector< T, Allo >::clear (    )  [inline]
 

00222                    {
00223     ((vector <T,Allo> *)this)->clear();
00224     id++;
00225       }

template<class T, class Allo = allocator <T>>
int std::safe_vector< T, Allo >::DIE_NOW (    )  [inline, static, private]
 

00005                          {
00006       return *(int*)0;
00007     }

template<class T, class Allo = allocator <T>>
const_iterator std::safe_vector< T, Allo >::end (    )  const [inline]
 

00183                                 {
00184     return const_iterator (((vector<T,Allo>*)this)->end(),this);
00185       }

template<class T, class Allo = allocator <T>>
iterator std::safe_vector< T, Allo >::end (    )  [inline]
 

00180                      {
00181     return iterator (((vector<T,Allo>*)this)->end(),this);
00182       }

template<class T, class Allo = allocator <T>>
iterator std::safe_vector< T, Allo >::erase (  iterator    a )  [inline]
 

00226                                   {
00227     a.check_relevance();
00228     id++;
00229     return iterator (((vector <T,Allo> *)this)->erase(a),this);
00230     
00231       }

template<class T, class Allo = allocator <T>>
iterator std::safe_vector< T, Allo >::erase (  iterator    a,
iterator    b
)  [inline]
 

00189                                               {
00190     a.check_relevance();
00191     b.check_relevance();
00192     id++;
00193     return iterator (((vector <T,Allo> *)this)->erase(a,b),this);
00194       }

template<class T, class Allo = allocator <T>>
const T& std::safe_vector< T, Allo >::front (    )  const [inline]
 

00218                             {
00219       if (size()>0) return ((vector <T,Allo> *)this)->front();      
00220     }

template<class T, class Allo = allocator <T>>
T& std::safe_vector< T, Allo >::front (    )  [inline]
 

00215                 {
00216       if (size()>0) return ((vector <T,Allo> *)this)->front();      
00217     }

template<class T, class Allo = allocator <T>>
iterator std::safe_vector< T, Allo >::insert (  iterator    positn,
unsigned int    n
)  [inline]
 

00250                                                         {
00251     positn.check_relevance();
00252     vector<T,Allo>::iterator i=vector<T,Allo>::insert (positn,n);
00253     id++;
00254     return iterator(i,this);
00255       }

template<class T, class Allo = allocator <T>>
iterator std::safe_vector< T, Allo >::insert (  iterator    positn )  [inline]
 

00244                                         {
00245     positn.check_relevance();
00246     vector<T,Allo>::iterator i=vector<T,Allo>::insert (positn);
00247     id++;
00248     return iterator(i,this);
00249       }

template<class T, class Allo = allocator <T>>
iterator std::safe_vector< T, Allo >::insert (  iterator    positn,
unsigned int    n,
const T &    t
)  [inline]
 

00238                                                                     {
00239     positn.check_relevance();
00240     vector<T,Allo>::iterator i=vector<T,Allo>::insert (positn,n,t);
00241     id++;
00242     return iterator(i,this);
00243       }

template<class T, class Allo = allocator <T>>
iterator std::safe_vector< T, Allo >::insert (  iterator    positn,
const T &    t
)  [inline]
 

00232                                                     {
00233     positn.check_relevance();
00234     vector<T,Allo>::iterator i=vector<T,Allo>::insert (positn,t);
00235     id++;
00236     return iterator(i,this);
00237       }

template<class T, class Allo = allocator <T>>
vector<T,Allo>& std::safe_vector< T, Allo >::operator= (  const vector< T, Allo > &    k )  [inline]
 

00045                                                             {
00046     *((vector <T,Allo> *)this) = k;
00047     id=temprand();
00048     return k;
00049       }

template<class T, class Allo = allocator <T>>
const vector<T,Allo>& std::safe_vector< T, Allo >::operator= (  const vector< T, Allo > &    a )  [inline]
 

00028                                                                    {
00029     *((vector <T,Allo>*)this)=a;
00030     id = temprand();
00031     return a;
00032       }

template<class T, class Allo = allocator <T>>
const T& std::safe_vector< T, Allo >::operator[] (  unsigned int    n )  const [inline]
 

00034 {return (*((vector <T,Allo> *)this)).at(n);}

template<class T, class Allo = allocator <T>>
T& std::safe_vector< T, Allo >::operator[] (  unsigned int    n )  [inline]
 

00033 { return (*((vector <T,Allo> *)this)).at(n); }

template<class T, class Allo = allocator <T>>
void std::safe_vector< T, Allo >::push_back (    )  [inline]
 

00041                         {
00042     vector<T,Allo>::push_back();
00043     id++;
00044       }

template<class T, class Allo = allocator <T>>
void std::safe_vector< T, Allo >::push_back (  const T &    t )  [inline]
 

00037                                   {
00038     vector<T,Allo>::push_back(t);
00039     id++;
00040       }

template<class T, class Allo = allocator <T>>
void std::safe_vector< T, Allo >::reserve (  unsigned int    n )  [inline]
 

00050                                     {
00051     vector<T,Allo>::reserve (n);
00052     id++;
00053       }

template<class T, class Allo = allocator <T>>
void std::safe_vector< T, Allo >::resize (  size_type    ns )  [inline]
 

00205                                  {
00206     ((vector <T,Allo> *)this)->resize(ns);
00207     id++;
00208       }

template<class T, class Allo = allocator <T>>
void std::safe_vector< T, Allo >::resize (  size_type    ns,
const T &    x
)  [inline]
 

00201                                               {
00202     ((vector <T,Allo> *)this)->resize(ns,x);
00203     id++;
00204       }

template<class T, class Allo = allocator <T>>
void std::safe_vector< T, Allo >::swap (  safe_vector< T, Allo > &    a )  [inline]
 

00195                                           {
00196     temp = id;
00197     id = a.id;
00198     a.id = temp;
00199     ((vector <T,Allo> *)this)->swap (a);
00200       }

template<class T, class Allo = allocator <T>>
int std::safe_vector< T, Allo >::temprand (    )  [inline, static, private]
 

00009                             {
00010     static int seed;
00011     return seed += 319282;
00012       
00013       }


Member Data Documentation

template<class T, class Allo = allocator <T>>
int std::safe_vector< T, Allo >::id [private]
 


The documentation for this class was generated from the following file:
Generated on Mon Jul 7 21:13:57 2003 for Ethereal by doxygen1.2.15