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, A > Class Template Reference

supports vector with external allocator size of empty vector is 8 byte More...

#include <vector.h>

Inheritance diagram for _vector< T, A >:

base_vector< T >

List of all members.

Public Member Functions

 _vector ()
 constructor
 ~_vector ()
 destructor
 _vector (const _vector< T, A > &x)
 copy constructor copies only pointer to first element and length no memory reallocation or copy
_vector< T, A > & operator= (const _vector< T, A > &x)
 assign operator copies only pointer to first element and length no reallocation or copying of memory
bool assign (A &allocator_, TYPENAME _vector< T, A >::const_iterator first, TYPENAME _vector< T, A >::const_iterator last)
 assign range of iterators
bool assign (A &allocator_, size_t n, const T &x=T())
 assigns n equal values
bool assign (A &allocator_, const _vector< T, A > &x)
 assigns another vector copies values
bool resize (A &allocator_, size_t n, const T &x)
 expands boundaries if needed must be defined as a copy constructor for template T
bool resize (A &allocator_, size_t n)
 expands boundaries if needed
void reduce (size_t n)
 reduces boundaries if needed no memory deallocation, no destructors invoked
void clear ()
 clear vector
void clear (array_allocator< T > &allocator_)
 clears vector and deallocates memory on external allocator

Private Member Functions

void _reduce (size_t n)
 reduces size of vector no memory deallocation
T * _buynodes (byte_allocator &allocator_, size_t n)
 allocates array of objects on external byte_allocator
T * _buynodes (array_allocator< T > &allocator_, size_t n)
 allocates array of objects on external array_allocator


Detailed Description

template<class T, class A = byte_allocator>
class _vector< T, A >

supports vector with external allocator size of empty vector is 8 byte

Definition at line 87 of file vector.h.


Constructor & Destructor Documentation

template<class T, class A>
_vector< T, A >::_vector (  )  [inline]

constructor

Definition at line 140 of file vector.hpp.

template<class T, class A>
_vector< T, A >::~_vector (  )  [inline]

destructor

Definition at line 148 of file vector.hpp.

References _vector< T, A >::clear().

template<class T, class A>
_vector< T, A >::_vector ( const _vector< T, A > &  x  )  [inline]

copy constructor copies only pointer to first element and length no memory reallocation or copy

Definition at line 156 of file vector.hpp.


Member Function Documentation

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

assign operator copies only pointer to first element and length no reallocation or copying of memory

Definition at line 168 of file vector.hpp.

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

template<class T, class A>
bool _vector< T, A >::assign ( A &  allocator_,
TYPENAME _vector< T, A >::const_iterator  first,
TYPENAME _vector< T, A >::const_iterator  last 
) [inline]

assign range of iterators

Parameters:
allocator_  external allocator
first  first iterator
last  last iterator

Definition at line 183 of file vector.hpp.

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

Referenced by content_children::build_dfa().

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

assigns n equal values

Parameters:
allocator_  external allocator
n  number of elements
x  object

Definition at line 200 of file vector.hpp.

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

template<class T, class A>
bool _vector< T, A >::assign ( A &  allocator_,
const _vector< T, A > &  x 
) [inline]

assigns another vector copies values

Parameters:
allocator_  external allocator
x  input vector

Definition at line 212 of file vector.hpp.

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

template<class T, class A>
bool _vector< T, A >::resize ( A &  allocator_,
size_t  n 
) [inline]

expands boundaries if needed

Parameters:
allocator_  external allocator
n  new vector length

Definition at line 256 of file vector.hpp.

References _vector< T, A >::_buynodes(), base_vector< T >::_first, base_vector< T >::_length, and _vector< T, A >::_reduce().

template<class T, class A>
void _vector< T, A >::reduce ( size_t  n  )  [inline]

reduces boundaries if needed no memory deallocation, no destructors invoked

Parameters:
n  new vector length

Definition at line 281 of file vector.hpp.

References base_vector< T >::_length, and _vector< T, A >::_reduce().

Referenced by content_children::build_dfa().

template<class T, class A>
void _vector< T, A >::clear (  )  [inline]

template<class T, class A>
void _vector< T, A >::clear ( array_allocator< T > &  allocator_  )  [inline]

clears vector and deallocates memory on external allocator

Parameters:
allocator_  external allocator

Definition at line 302 of file vector.hpp.

References base_vector< T >::_first, and rep_allocator::deallocate().

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

reduces size of vector no memory deallocation

Parameters:
n  new vector size

Definition at line 313 of file vector.hpp.

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

Referenced by _vector< T, A >::reduce(), and _vector< T, A >::resize().

template<class T, class A>
T * _vector< T, A >::_buynodes ( byte_allocator allocator_,
size_t  n 
) [inline, private]

allocates array of objects on external byte_allocator

Parameters:
allocator_  external allocator
n  new vector size

Definition at line 327 of file vector.hpp.

References byte_allocator::allocate().

Referenced by _vector< T, A >::resize().

template<class T, class A>
T * _vector< T, A >::_buynodes ( array_allocator< T > &  allocator_,
size_t  n 
) [inline, private]

allocates array of objects on external array_allocator

Parameters:
allocator_  external allocator
n  new array size

Definition at line 335 of file vector.hpp.

References array_allocator< T >::allocate().


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


© Copyright Terimber 2003-.