reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
resip::StlPoolAllocator< T, P > Class Template Reference

A dirt-simple lightweight stl pool allocator meant for use in short-lifetime objects. More...

#include <StlPoolAllocator.hxx>

Classes

struct  rebind
 

Public Types

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

Public Member Functions

 StlPoolAllocator (P *pool=0)
 
 StlPoolAllocator (const StlPoolAllocator &other)
 
StlPoolAllocator & operator= (const StlPoolAllocator &rhs)
 
template<typename U >
 StlPoolAllocator (const StlPoolAllocator< U, P > &other)
 
 ~StlPoolAllocator ()
 
pointer address (reference ref) const
 
const_pointer address (const_reference ref) const
 
pointer allocate (size_type n, const void *hint=0)
 
void deallocate (pointer ptr, size_type n)
 
void * allocate_raw (size_type bytes)
 
void deallocate_raw (void *ptr)
 
size_type max_size () const
 
size_type max_size (size_type _sz) const
 
void construct (pointer p, const_reference orig)
 
void destroy (pointer ptr)
 
bool operator== (const StlPoolAllocator &rhs) const
 
bool operator!= (const StlPoolAllocator &rhs) const
 

Public Attributes

P * mPool
 

Detailed Description

template<typename T, typename P>
class resip::StlPoolAllocator< T, P >

A dirt-simple lightweight stl pool allocator meant for use in short-lifetime objects.

This will pool-allocate at most S bytes, after which no further pool allocation will be performed, and fallback to the system new/delete will be used (deallocating a pool allocated object will not free up room in the pool).

Definition at line 28 of file StlPoolAllocator.hxx.

Member Typedef Documentation

◆ const_pointer

template<typename T , typename P >
typedef const value_type* resip::StlPoolAllocator< T, P >::const_pointer

Definition at line 33 of file StlPoolAllocator.hxx.

◆ const_reference

template<typename T , typename P >
typedef const value_type& resip::StlPoolAllocator< T, P >::const_reference

Definition at line 35 of file StlPoolAllocator.hxx.

◆ difference_type

template<typename T , typename P >
typedef ptrdiff_t resip::StlPoolAllocator< T, P >::difference_type

Definition at line 37 of file StlPoolAllocator.hxx.

◆ pointer

template<typename T , typename P >
typedef value_type* resip::StlPoolAllocator< T, P >::pointer

Definition at line 32 of file StlPoolAllocator.hxx.

◆ reference

template<typename T , typename P >
typedef value_type& resip::StlPoolAllocator< T, P >::reference

Definition at line 34 of file StlPoolAllocator.hxx.

◆ size_type

template<typename T , typename P >
typedef size_t resip::StlPoolAllocator< T, P >::size_type

Definition at line 36 of file StlPoolAllocator.hxx.

◆ value_type

template<typename T , typename P >
typedef T resip::StlPoolAllocator< T, P >::value_type

Definition at line 31 of file StlPoolAllocator.hxx.

Constructor & Destructor Documentation

◆ StlPoolAllocator() [1/3]

template<typename T , typename P >
resip::StlPoolAllocator< T, P >::StlPoolAllocator ( P *  pool = 0)
inlineexplicit

Definition at line 55 of file StlPoolAllocator.hxx.

◆ StlPoolAllocator() [2/3]

template<typename T , typename P >
resip::StlPoolAllocator< T, P >::StlPoolAllocator ( const StlPoolAllocator< T, P > &  other)
inline

Definition at line 57 of file StlPoolAllocator.hxx.

◆ StlPoolAllocator() [3/3]

template<typename T , typename P >
template<typename U >
resip::StlPoolAllocator< T, P >::StlPoolAllocator ( const StlPoolAllocator< U, P > &  other)
inline

Definition at line 67 of file StlPoolAllocator.hxx.

◆ ~StlPoolAllocator()

template<typename T , typename P >
resip::StlPoolAllocator< T, P >::~StlPoolAllocator ( )
inline

Definition at line 70 of file StlPoolAllocator.hxx.

Member Function Documentation

◆ address() [1/2]

template<typename T , typename P >
const_pointer resip::StlPoolAllocator< T, P >::address ( const_reference  ref) const
inline

Definition at line 84 of file StlPoolAllocator.hxx.

◆ address() [2/2]

template<typename T , typename P >
pointer resip::StlPoolAllocator< T, P >::address ( reference  ref) const
inline

Definition at line 79 of file StlPoolAllocator.hxx.

◆ allocate()

template<typename T , typename P >
pointer resip::StlPoolAllocator< T, P >::allocate ( size_type  n,
const void *  hint = 0 
)
inline

Definition at line 89 of file StlPoolAllocator.hxx.

◆ allocate_raw()

template<typename T , typename P >
void * resip::StlPoolAllocator< T, P >::allocate_raw ( size_type  bytes)
inline

Definition at line 99 of file StlPoolAllocator.hxx.

◆ construct()

template<typename T , typename P >
void resip::StlPoolAllocator< T, P >::construct ( pointer  p,
const_reference  orig 
)
inline

Definition at line 136 of file StlPoolAllocator.hxx.

◆ deallocate()

template<typename T , typename P >
void resip::StlPoolAllocator< T, P >::deallocate ( pointer  ptr,
size_type  n 
)
inline

Definition at line 94 of file StlPoolAllocator.hxx.

◆ deallocate_raw()

template<typename T , typename P >
void resip::StlPoolAllocator< T, P >::deallocate_raw ( void *  ptr)
inline

Definition at line 108 of file StlPoolAllocator.hxx.

◆ destroy()

template<typename T , typename P >
void resip::StlPoolAllocator< T, P >::destroy ( pointer  ptr)
inline

Definition at line 141 of file StlPoolAllocator.hxx.

◆ max_size() [1/2]

template<typename T , typename P >
size_type resip::StlPoolAllocator< T, P >::max_size ( ) const
inline

Definition at line 118 of file StlPoolAllocator.hxx.

◆ max_size() [2/2]

template<typename T , typename P >
size_type resip::StlPoolAllocator< T, P >::max_size ( size_type  _sz) const
inline

Definition at line 127 of file StlPoolAllocator.hxx.

◆ operator!=()

template<typename T , typename P >
bool resip::StlPoolAllocator< T, P >::operator!= ( const StlPoolAllocator< T, P > &  rhs) const
inline

Definition at line 151 of file StlPoolAllocator.hxx.

◆ operator=()

template<typename T , typename P >
StlPoolAllocator & resip::StlPoolAllocator< T, P >::operator= ( const StlPoolAllocator< T, P > &  rhs)
inline

Definition at line 59 of file StlPoolAllocator.hxx.

◆ operator==()

template<typename T , typename P >
bool resip::StlPoolAllocator< T, P >::operator== ( const StlPoolAllocator< T, P > &  rhs) const
inline

Definition at line 146 of file StlPoolAllocator.hxx.

Member Data Documentation

◆ mPool

template<typename T , typename P >
P* resip::StlPoolAllocator< T, P >::mPool

Definition at line 156 of file StlPoolAllocator.hxx.


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