Ardour  9.0-pre0-582-g084a23a80d
PBD::StackAllocator< T, stack_capacity > Class Template Reference

#include <stack_allocator.h>

Classes

struct  rebind
 

Public Types

typedef T value_type
 
typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 

Public Member Functions

 StackAllocator ()
 
 StackAllocator (const StackAllocator &)
 
template<typename U , size_t other_capacity>
 StackAllocator (const StackAllocator< U, other_capacity > &)
 
pointer allocate (size_type n, void *hint=0)
 
void deallocate (pointer p, size_type n)
 
size_type max_size () const throw ()
 
bool operator== (StackAllocator const &a) const
 
bool operator!= (StackAllocator const &a) const
 
template<class U >
void destroy (U *const p)
 
template<class U >
void construct (U *const p)
 
template<class U , class A >
void construct (U *const p, A const &a)
 

Private Types

typedef boost::aligned_storage< sizeof(T) *stack_capacity, 16 >::type align_t
 

Private Member Functions

StackAllocatoroperator= (const StackAllocator &)
 
bool pointer_in_buffer (pointer const p)
 

Private Attributes

align_t _buf
 
pointer _ptr
 

Detailed Description

template<class T, std::size_t stack_capacity>
class PBD::StackAllocator< T, stack_capacity >

Definition at line 37 of file stack_allocator.h.

Member Typedef Documentation

◆ align_t

template<class T , std::size_t stack_capacity>
typedef boost::aligned_storage<sizeof (T) * stack_capacity, 16>::type PBD::StackAllocator< T, stack_capacity >::align_t
private

Definition at line 153 of file stack_allocator.h.

◆ const_pointer

template<class T , std::size_t stack_capacity>
typedef const value_type* PBD::StackAllocator< T, stack_capacity >::const_pointer

Definition at line 53 of file stack_allocator.h.

◆ const_reference

template<class T , std::size_t stack_capacity>
typedef const value_type& PBD::StackAllocator< T, stack_capacity >::const_reference

Definition at line 55 of file stack_allocator.h.

◆ difference_type

template<class T , std::size_t stack_capacity>
typedef std::ptrdiff_t PBD::StackAllocator< T, stack_capacity >::difference_type

Definition at line 51 of file stack_allocator.h.

◆ pointer

template<class T , std::size_t stack_capacity>
typedef value_type* PBD::StackAllocator< T, stack_capacity >::pointer

Definition at line 52 of file stack_allocator.h.

◆ reference

template<class T , std::size_t stack_capacity>
typedef value_type& PBD::StackAllocator< T, stack_capacity >::reference

Definition at line 54 of file stack_allocator.h.

◆ size_type

template<class T , std::size_t stack_capacity>
typedef std::size_t PBD::StackAllocator< T, stack_capacity >::size_type

Definition at line 50 of file stack_allocator.h.

◆ value_type

template<class T , std::size_t stack_capacity>
typedef T PBD::StackAllocator< T, stack_capacity >::value_type

Definition at line 49 of file stack_allocator.h.

Constructor & Destructor Documentation

◆ StackAllocator() [1/3]

template<class T , std::size_t stack_capacity>
PBD::StackAllocator< T, stack_capacity >::StackAllocator ( )
inline

Definition at line 63 of file stack_allocator.h.

◆ StackAllocator() [2/3]

template<class T , std::size_t stack_capacity>
PBD::StackAllocator< T, stack_capacity >::StackAllocator ( const StackAllocator< T, stack_capacity > &  )
inline

Definition at line 67 of file stack_allocator.h.

◆ StackAllocator() [3/3]

template<class T , std::size_t stack_capacity>
template<typename U , size_t other_capacity>
PBD::StackAllocator< T, stack_capacity >::StackAllocator ( const StackAllocator< U, other_capacity > &  )
inline

Definition at line 72 of file stack_allocator.h.

Member Function Documentation

◆ allocate()

template<class T , std::size_t stack_capacity>
pointer PBD::StackAllocator< T, stack_capacity >::allocate ( size_type  n,
void *  hint = 0 
)
inline

Definition at line 77 of file stack_allocator.h.

◆ construct() [1/2]

template<class T , std::size_t stack_capacity>
template<class U >
void PBD::StackAllocator< T, stack_capacity >::construct ( U *const  p)
inline

Definition at line 126 of file stack_allocator.h.

◆ construct() [2/2]

template<class T , std::size_t stack_capacity>
template<class U , class A >
void PBD::StackAllocator< T, stack_capacity >::construct ( U *const  p,
A const &  a 
)
inline

Definition at line 139 of file stack_allocator.h.

◆ deallocate()

template<class T , std::size_t stack_capacity>
void PBD::StackAllocator< T, stack_capacity >::deallocate ( pointer  p,
size_type  n 
)
inline

Definition at line 90 of file stack_allocator.h.

◆ destroy()

template<class T , std::size_t stack_capacity>
template<class U >
void PBD::StackAllocator< T, stack_capacity >::destroy ( U *const  p)
inline

Definition at line 120 of file stack_allocator.h.

◆ max_size()

template<class T , std::size_t stack_capacity>
size_type PBD::StackAllocator< T, stack_capacity >::max_size ( ) const
throw (
)
inline

Definition at line 104 of file stack_allocator.h.

◆ operator!=()

template<class T , std::size_t stack_capacity>
bool PBD::StackAllocator< T, stack_capacity >::operator!= ( StackAllocator< T, stack_capacity > const &  a) const
inline

Definition at line 114 of file stack_allocator.h.

◆ operator=()

template<class T , std::size_t stack_capacity>
StackAllocator& PBD::StackAllocator< T, stack_capacity >::operator= ( const StackAllocator< T, stack_capacity > &  )
private

◆ operator==()

template<class T , std::size_t stack_capacity>
bool PBD::StackAllocator< T, stack_capacity >::operator== ( StackAllocator< T, stack_capacity > const &  a) const
inline

Definition at line 109 of file stack_allocator.h.

◆ pointer_in_buffer()

template<class T , std::size_t stack_capacity>
bool PBD::StackAllocator< T, stack_capacity >::pointer_in_buffer ( pointer const  p)
inlineprivate

Definition at line 148 of file stack_allocator.h.

Member Data Documentation

◆ _buf

template<class T , std::size_t stack_capacity>
align_t PBD::StackAllocator< T, stack_capacity >::_buf
private

Definition at line 155 of file stack_allocator.h.

◆ _ptr

template<class T , std::size_t stack_capacity>
pointer PBD::StackAllocator< T, stack_capacity >::_ptr
private

Definition at line 156 of file stack_allocator.h.


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