FEI Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
fei_Pool_alloc< T > Class Template Reference

#include <fei_Pool_alloc.hpp>

Inheritance diagram for fei_Pool_alloc< T >:

Classes

struct  rebind

Public Types

typedef T value_type
typedef std::size_t size_type
typedef T * pointer
typedef const T * const_pointer
typedef T & reference
typedef const T & const_reference
typedef std::ptrdiff_t difference_type

Public Member Functions

pointer address (reference value) const
const_pointer address (const_reference value) const
 fei_Pool_alloc () throw ()
 fei_Pool_alloc (const T &) throw ()
template<typename U>
 fei_Pool_alloc (const fei_Pool_alloc< U > &) throw ()
 ~fei_Pool_alloc () throw ()
pointer allocate (size_type n, const void *hint=NULL)
void deallocate (pointer p, size_type n)
template<typename U>
void construct (U *p, const U &val)
void construct (pointer p, const T &val)
template<typename U>
void destroy (U *p)
void destroy (pointer p)
size_type max_size () const throw ()

Private Attributes

fei_Poolmem
size_t n_

Detailed Description

template<typename T>
class fei_Pool_alloc< T >

fei_Pool_alloc (along with its underlying memory-pool class fei_Pool) is taken almost verbatim from Stroustrup's book "The C++ Programming Language 3rd edition", pages 567-572.

The difference between this class and the one in the book is that the length of allocated memory-chunks must always be the same. That is, the first time allocate is called, an internal memory-pool is created with the specified alloc-size. That memory-pool can only satisfy allocation requests of that same size from then on.

Definition at line 34 of file fei_Pool_alloc.hpp.

Member Typedef Documentation

◆ value_type

template<typename T>
typedef T fei_Pool_alloc< T >::value_type

Definition at line 40 of file fei_Pool_alloc.hpp.

◆ size_type

template<typename T>
typedef std::size_t fei_Pool_alloc< T >::size_type

Definition at line 41 of file fei_Pool_alloc.hpp.

◆ pointer

template<typename T>
typedef T* fei_Pool_alloc< T >::pointer

Definition at line 42 of file fei_Pool_alloc.hpp.

◆ const_pointer

template<typename T>
typedef const T* fei_Pool_alloc< T >::const_pointer

Definition at line 43 of file fei_Pool_alloc.hpp.

◆ reference

template<typename T>
typedef T& fei_Pool_alloc< T >::reference

Definition at line 44 of file fei_Pool_alloc.hpp.

◆ const_reference

template<typename T>
typedef const T& fei_Pool_alloc< T >::const_reference

Definition at line 45 of file fei_Pool_alloc.hpp.

◆ difference_type

template<typename T>
typedef std::ptrdiff_t fei_Pool_alloc< T >::difference_type

Definition at line 46 of file fei_Pool_alloc.hpp.

Constructor & Destructor Documentation

◆ fei_Pool_alloc() [1/3]

template<typename T>
fei_Pool_alloc< T >::fei_Pool_alloc ( )
throw ( )

Definition at line 90 of file fei_Pool_alloc.hpp.

References mem, and n_.

◆ fei_Pool_alloc() [2/3]

template<typename T>
fei_Pool_alloc< T >::fei_Pool_alloc ( const T & )
throw ( )

Definition at line 91 of file fei_Pool_alloc.hpp.

References mem, and n_.

◆ fei_Pool_alloc() [3/3]

template<typename T>
template<typename U>
fei_Pool_alloc< T >::fei_Pool_alloc ( const fei_Pool_alloc< U > & )
throw ( )
inline

Definition at line 66 of file fei_Pool_alloc.hpp.

◆ ~fei_Pool_alloc()

template<typename T>
fei_Pool_alloc< T >::~fei_Pool_alloc ( )
throw ( )

Definition at line 93 of file fei_Pool_alloc.hpp.

Member Function Documentation

◆ address() [1/2]

template<typename T>
pointer fei_Pool_alloc< T >::address ( reference value) const
inline

Definition at line 55 of file fei_Pool_alloc.hpp.

◆ address() [2/2]

template<typename T>
const_pointer fei_Pool_alloc< T >::address ( const_reference value) const
inline

Definition at line 59 of file fei_Pool_alloc.hpp.

◆ allocate()

template<typename T>
T * fei_Pool_alloc< T >::allocate ( size_type n,
const void * hint = NULL )

Definition at line 96 of file fei_Pool_alloc.hpp.

References get_fei_mem_pool(), mem, and n_.

Referenced by fei::insert_row(), and test_misc::serialtest3().

◆ deallocate()

template<typename T>
void fei_Pool_alloc< T >::deallocate ( pointer p,
size_type n )

Definition at line 114 of file fei_Pool_alloc.hpp.

References mem, and n_.

◆ construct() [1/2]

template<typename T>
template<typename U>
void fei_Pool_alloc< T >::construct ( U * p,
const U & val )
inline

Definition at line 74 of file fei_Pool_alloc.hpp.

Referenced by fei::insert_row(), and test_misc::serialtest3().

◆ construct() [2/2]

template<typename T>
void fei_Pool_alloc< T >::construct ( pointer p,
const T & val )
inline

Definition at line 77 of file fei_Pool_alloc.hpp.

◆ destroy() [1/2]

template<typename T>
template<typename U>
void fei_Pool_alloc< T >::destroy ( U * p)
inline

Definition at line 80 of file fei_Pool_alloc.hpp.

Referenced by test_misc::serialtest3().

◆ destroy() [2/2]

template<typename T>
void fei_Pool_alloc< T >::destroy ( pointer p)
inline

Definition at line 83 of file fei_Pool_alloc.hpp.

◆ max_size()

template<typename T>
size_type fei_Pool_alloc< T >::max_size ( ) const
throw ( )
inline

Definition at line 86 of file fei_Pool_alloc.hpp.

Member Data Documentation

◆ mem

template<typename T>
fei_Pool* fei_Pool_alloc< T >::mem
private

Definition at line 36 of file fei_Pool_alloc.hpp.

Referenced by allocate(), deallocate(), fei_Pool_alloc(), and fei_Pool_alloc().

◆ n_

template<typename T>
size_t fei_Pool_alloc< T >::n_
private

Definition at line 37 of file fei_Pool_alloc.hpp.

Referenced by allocate(), deallocate(), fei_Pool_alloc(), and fei_Pool_alloc().


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