FEI Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
fei_Pool_alloc< T > Class Template Reference

#include <fei_Pool_alloc.hpp>

Inheritance diagram for fei_Pool_alloc< T >:
Inheritance graph
[legend]

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

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

Definition at line 40 of file fei_Pool_alloc.hpp.

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

Definition at line 41 of file fei_Pool_alloc.hpp.

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

Definition at line 42 of file fei_Pool_alloc.hpp.

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

Definition at line 43 of file fei_Pool_alloc.hpp.

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

Definition at line 44 of file fei_Pool_alloc.hpp.

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

Definition at line 45 of file fei_Pool_alloc.hpp.

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

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

Definition at line 90 of file fei_Pool_alloc.hpp.

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

Definition at line 91 of file fei_Pool_alloc.hpp.

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.

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

Definition at line 93 of file fei_Pool_alloc.hpp.

Member Function Documentation

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

Definition at line 55 of file fei_Pool_alloc.hpp.

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.

template<typename T >
T * fei_Pool_alloc< T >::allocate ( size_type  n,
const void *  hint = NULL 
)
template<typename T >
void fei_Pool_alloc< T >::deallocate ( pointer  p,
size_type  n 
)
template<typename T>
template<typename U >
void fei_Pool_alloc< T >::construct ( U *  p,
const U &  val 
)
inline
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.

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

Definition at line 83 of file fei_Pool_alloc.hpp.

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

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

Definition at line 36 of file fei_Pool_alloc.hpp.

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

Definition at line 37 of file fei_Pool_alloc.hpp.


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