growable_vector< T > Class Template Reference

#include <growable_vector.h>

Public Types

typedef std::vector< T > container_type
typedef container_type::size_type size_type

Public Member Functions

operator[] (size_type index) const
T & operator[] (size_type index)
growable_vector< T > & operator+= (growable_vector< T > const &rhs)
growable_vector< T > & operator-= (growable_vector< T > const &rhs)
size_type size () const
 return current size of vector
void fill (size_type size, T const &value)
 fill container with given value
bool zero () const
 return true if all elements have the default constructed value

Private Attributes

container_type container

Detailed Description

template<typename T>
class growable_vector< T >

A simple growable vector template.

Definition at line 22 of file growable_vector.h.


Member Typedef Documentation

template<typename T>
typedef std::vector<T> growable_vector< T >::container_type

Definition at line 24 of file growable_vector.h.

template<typename T>
typedef container_type::size_type growable_vector< T >::size_type

Definition at line 25 of file growable_vector.h.


Member Function Documentation

template<typename T>
void growable_vector< T >::fill ( size_type  size,
T const &  value 
) [inline]

fill container with given value

Definition at line 89 of file growable_vector.h.

template<typename T>
growable_vector<T>& growable_vector< T >::operator+= ( growable_vector< T > const &  rhs  )  [inline]

vectorized += operator

Definition at line 54 of file growable_vector.h.

template<typename T>
growable_vector<T>& growable_vector< T >::operator-= ( growable_vector< T > const &  rhs  )  [inline]

vectorized -= operator, overflow shouldn't occur during substraction (iow: for each components lhs[i] >= rhs[i]

Definition at line 70 of file growable_vector.h.

template<typename T>
T& growable_vector< T >::operator[] ( size_type  index  )  [inline]

Index into the vector for a value. If the index is larger than the current max index, the array is expanded, default-filling any intermediary gaps.

Definition at line 44 of file growable_vector.h.

template<typename T>
T growable_vector< T >::operator[] ( size_type  index  )  const [inline]

Index into the vector for a value. An out of bounds index will return a default-constructed value.

Definition at line 32 of file growable_vector.h.

template<typename T>
size_type growable_vector< T >::size (  )  const [inline]

return current size of vector

Definition at line 83 of file growable_vector.h.

template<typename T>
bool growable_vector< T >::zero (  )  const [inline]

return true if all elements have the default constructed value

Definition at line 95 of file growable_vector.h.


Field Documentation

template<typename T>
container_type growable_vector< T >::container [private]

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

Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1