Thread portable class


Gate portable class


Timer class


Pool class


Terimber 2.0


About C++


Downloads Products & Services Support Clients Open Source About



Home / Open source / Terimber 2.0

vector< T > Class Template Reference

class supports vector with internal allocator More...

#include <vector.h>

Inheritance diagram for vector< T >:

base_vector< T >

List of all members.

Public Member Functions

 vector (size_t capacity=os_def_size)
 constructor
 ~vector ()
 destructor
 vector (const vector< T > &x)
 copy constructor
vector< T > & operator= (const vector< T > &x)
 assign operator
bool assign (TYPENAME vector< T >::const_iterator first, TYPENAME vector< T >::const_iterator last)
 assigns range of iterators
bool assign (size_t n, const T &x=T())
 assigns n equal copies
bool assign (const vector< T > &x)
 assigns another vector
bool resize (size_t n, const T &x=T())
 expands boundaries if needed must be defined as a copy constructor for template T
void clear ()
 clears vector

Private Member Functions

void _reduce (size_t n)
 reduces size of vector
T * _buynodes (size_t n)
 allocates array of nodes

Private Attributes

array_allocator< T > _allocator
 internal allocator


Detailed Description

template<class T>
class vector< T >

class supports vector with internal allocator

Definition at line 182 of file vector.h.


Constructor & Destructor Documentation

template<class T>
vector< T >::vector ( size_t  capacity = os_def_size  )  [inline]

constructor

Parameters:
capacity  chunk size for array_allocator

Definition at line 345 of file vector.hpp.

template<class T>
vector< T >::~vector (  )  [inline]

destructor

Definition at line 353 of file vector.hpp.

References vector< T >::clear().

template<class T>
vector< T >::vector ( const vector< T > &  x  )  [inline]

copy constructor

Definition at line 361 of file vector.hpp.


Member Function Documentation

template<class T>
vector< T > & vector< T >::operator= ( const vector< T > &  x  )  [inline]

template<class T>
bool vector< T >::assign ( TYPENAME vector< T >::const_iterator  first,
TYPENAME vector< T >::const_iterator  last 
) [inline]

assigns range of iterators

Parameters:
first  first iterator
last  last iterator

Definition at line 391 of file vector.hpp.

References base_vector< T >::_first, vector< T >::clear(), and vector< T >::resize().

template<class T>
bool vector< T >::assign ( size_t  n,
const T &  x = T() 
) [inline]

assigns n equal copies

Parameters:
n  new vector size
x  object

Definition at line 408 of file vector.hpp.

References vector< T >::clear(), and vector< T >::resize().

template<class T>
bool vector< T >::assign ( const vector< T > &  x  )  [inline]

assigns another vector

Parameters:
x  input vector

Definition at line 419 of file vector.hpp.

References base_vector< T >::_first, base_vector< T >::_length, vector< T >::clear(), and vector< T >::resize().

template<class T>
bool vector< T >::resize ( size_t  n,
const T &  x = T() 
) [inline]

expands boundaries if needed must be defined as a copy constructor for template T

Parameters:
n  new vector size
x  object

Definition at line 436 of file vector.hpp.

References vector< T >::_buynodes(), base_vector< T >::_first, base_vector< T >::_length, vector< T >::_reduce(), and vector< T >::clear().

Referenced by memtable::add_index(), vector< T >::assign(), vector< T >::operator=(), dbserver_impl::resize_params(), and terimber_db_value_vector_impl::terimber_db_value_vector_impl().

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

template<class T>
void vector< T >::_reduce ( size_t  n  )  [inline, private]

reduces size of vector

Parameters:
n  new vector size

Definition at line 478 of file vector.hpp.

References vector< T >::_allocator, base_vector< T >::_first, and base_vector< T >::_length.

Referenced by vector< T >::resize().

template<class T>
T * vector< T >::_buynodes ( size_t  n  )  [inline, private]

allocates array of nodes

Parameters:
n  new vector size

Definition at line 497 of file vector.hpp.

References vector< T >::_allocator.

Referenced by vector< T >::resize().


Member Data Documentation

template<class T>
array_allocator< T > vector< T >::_allocator [private]

internal allocator

Definition at line 237 of file vector.h.

Referenced by vector< T >::_buynodes(), vector< T >::_reduce(), vector< T >::clear(), and vector< T >::operator=().


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


© Copyright Terimber 2003-.