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

array_allocator< T > Class Template Reference

template class for allocation of the array of objects it seems like this class covers the functionality of the previous one but the previous class (node_allocator) has better performance More...

#include <memory.h>

Inheritance diagram for array_allocator< T >:

rep_allocator byte_allocator

List of all members.

Public Member Functions

 array_allocator (size_t capacity=os_def_size)
 constructor
 ~array_allocator ()
 destructor
T * allocate (size_t n)
 allocates array of n elements

Private Member Functions

T * pop (size_t n)
 finds the array of requested length in repository


Detailed Description

template<class T>
class array_allocator< T >

template class for allocation of the array of objects it seems like this class covers the functionality of the previous one but the previous class (node_allocator) has better performance

Definition at line 217 of file memory.h.


Constructor & Destructor Documentation

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

constructor

Parameters:
capacity  default capacity

Definition at line 207 of file memory.hpp.

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

destructor

Definition at line 214 of file memory.hpp.


Member Function Documentation

template<class T>
T * array_allocator< T >::allocate ( size_t  n  )  [inline]

allocates array of n elements

Parameters:
n  number of elements

Reimplemented from byte_allocator.

Definition at line 221 of file memory.hpp.

References ALIGNED_SIZEOF, byte_allocator::allocate(), and array_allocator< T >::pop().

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

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

finds the array of requested length in repository

Parameters:
n  number of elements

Definition at line 241 of file memory.hpp.

References rep_allocator::_rep, chunk_stack::pop(), and chunk_stack::top().

Referenced by array_allocator< T >::allocate().


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


© Copyright Terimber 2003-.