QuantumLibrary
Bloomberg::quantum::StackAllocator< T, SIZE > Struct Template Reference

Provides a stack-based object pool to the underlying ContiguousPoolManager. The default buffer size is 1000. More...

#include <quantum_stack_allocator.h>

Inheritance diagram for Bloomberg::quantum::StackAllocator< T, SIZE >:
Bloomberg::quantum::ContiguousPoolManager< T >

Classes

struct  rebind
 

Public Types

typedef StackAllocator< T, SIZE > this_type
 
typedef T value_type
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef size_t size_type
 
typedef std::ptrdiff_t difference_type
 
typedef std::false_type propagate_on_container_move_assignment
 
typedef std::false_type propagate_on_container_copy_assignment
 
typedef std::false_type propagate_on_container_swap
 
typedef std::false_type is_always_equal
 
typedef std::true_type default_constructor
 
typedef std::aligned_storage< sizeof(value_type), alignof(value_type)> storage_type
 
typedef storage_type::type aligned_type
 
- Public Types inherited from Bloomberg::quantum::ContiguousPoolManager< T >
typedef ContiguousPoolManager< T > this_type
 
typedef T value_type
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef size_t size_type
 
typedef uint16_t index_type
 
typedef std::aligned_storage< sizeof(T), alignof(T)> storage_type
 
typedef storage_type::type aligned_type
 

Public Member Functions

 StackAllocator ()
 
 StackAllocator (const this_type &)
 
StackAllocatoroperator= (const this_type &)
 
template<typename U >
 StackAllocator (const StackAllocator< U, SIZE > &)
 
template<typename U >
StackAllocatoroperator= (const StackAllocator< U, SIZE > &)
 
bool operator== (const this_type &) const
 
bool operator!= (const this_type &) const
 
- Public Member Functions inherited from Bloomberg::quantum::ContiguousPoolManager< T >
 ContiguousPoolManager ()
 
 ContiguousPoolManager (aligned_type *buffer, index_type size)
 
 ContiguousPoolManager (const this_type &)=delete
 
 ContiguousPoolManager (this_type &&)
 
ContiguousPoolManageroperator= (const this_type &)=delete
 
ContiguousPoolManageroperator= (this_type &&)
 
virtual ~ContiguousPoolManager ()
 
void setBuffer (aligned_type *buffer, index_type size)
 
pointer address (reference x) const
 
const_pointer address (const_reference x) const
 
size_type max_size () const
 
template<typename... Args>
void construct (T *p, Args &&... args)
 
void destroy (pointer p)
 
pointer allocate (size_type=1, const_pointer=0)
 
void deallocate (pointer p, size_type=1)
 
template<typename... Args>
pointer create (Args &&... args)
 
void dispose (pointer p)
 
size_t allocatedBlocks () const
 
size_t allocatedHeapBlocks () const
 
bool isFull () const
 
bool isEmpty () const
 

Static Public Member Functions

static StackAllocator select_on_container_copy_construction (const StackAllocator &)
 

Detailed Description

template<typename T, unsigned int SIZE>
struct Bloomberg::quantum::StackAllocator< T, SIZE >

Provides a stack-based object pool to the underlying ContiguousPoolManager. The default buffer size is 1000.

Template Parameters
TThe type to allocate.
SIZEThe size of the stack buffer.
Note
This allocator is thread safe. For internal use only.

Member Typedef Documentation

◆ aligned_type

template<typename T, unsigned int SIZE>
typedef storage_type::type Bloomberg::quantum::StackAllocator< T, SIZE >::aligned_type

◆ const_pointer

template<typename T, unsigned int SIZE>
typedef const value_type* Bloomberg::quantum::StackAllocator< T, SIZE >::const_pointer

◆ const_reference

template<typename T, unsigned int SIZE>
typedef const value_type& Bloomberg::quantum::StackAllocator< T, SIZE >::const_reference

◆ default_constructor

template<typename T, unsigned int SIZE>
typedef std::true_type Bloomberg::quantum::StackAllocator< T, SIZE >::default_constructor

◆ difference_type

template<typename T, unsigned int SIZE>
typedef std::ptrdiff_t Bloomberg::quantum::StackAllocator< T, SIZE >::difference_type

◆ is_always_equal

template<typename T, unsigned int SIZE>
typedef std::false_type Bloomberg::quantum::StackAllocator< T, SIZE >::is_always_equal

◆ pointer

template<typename T, unsigned int SIZE>
typedef value_type* Bloomberg::quantum::StackAllocator< T, SIZE >::pointer

◆ propagate_on_container_copy_assignment

template<typename T, unsigned int SIZE>
typedef std::false_type Bloomberg::quantum::StackAllocator< T, SIZE >::propagate_on_container_copy_assignment

◆ propagate_on_container_move_assignment

template<typename T, unsigned int SIZE>
typedef std::false_type Bloomberg::quantum::StackAllocator< T, SIZE >::propagate_on_container_move_assignment

◆ propagate_on_container_swap

template<typename T, unsigned int SIZE>
typedef std::false_type Bloomberg::quantum::StackAllocator< T, SIZE >::propagate_on_container_swap

◆ reference

template<typename T, unsigned int SIZE>
typedef value_type& Bloomberg::quantum::StackAllocator< T, SIZE >::reference

◆ size_type

template<typename T, unsigned int SIZE>
typedef size_t Bloomberg::quantum::StackAllocator< T, SIZE >::size_type

◆ storage_type

template<typename T, unsigned int SIZE>
typedef std::aligned_storage<sizeof(value_type), alignof(value_type)> Bloomberg::quantum::StackAllocator< T, SIZE >::storage_type

◆ this_type

template<typename T, unsigned int SIZE>
typedef StackAllocator<T, SIZE> Bloomberg::quantum::StackAllocator< T, SIZE >::this_type

◆ value_type

template<typename T, unsigned int SIZE>
typedef T Bloomberg::quantum::StackAllocator< T, SIZE >::value_type

Constructor & Destructor Documentation

◆ StackAllocator() [1/3]

template<typename T, unsigned int SIZE>
Bloomberg::quantum::StackAllocator< T, SIZE >::StackAllocator ( )
inline

◆ StackAllocator() [2/3]

template<typename T, unsigned int SIZE>
Bloomberg::quantum::StackAllocator< T, SIZE >::StackAllocator ( const this_type )
inline

◆ StackAllocator() [3/3]

template<typename T, unsigned int SIZE>
template<typename U >
Bloomberg::quantum::StackAllocator< T, SIZE >::StackAllocator ( const StackAllocator< U, SIZE > &  )
inline

Member Function Documentation

◆ operator!=()

template<typename T, unsigned int SIZE>
bool Bloomberg::quantum::StackAllocator< T, SIZE >::operator!= ( const this_type ) const
inline

◆ operator=() [1/2]

template<typename T, unsigned int SIZE>
StackAllocator& Bloomberg::quantum::StackAllocator< T, SIZE >::operator= ( const this_type )
inline

◆ operator=() [2/2]

template<typename T, unsigned int SIZE>
template<typename U >
StackAllocator& Bloomberg::quantum::StackAllocator< T, SIZE >::operator= ( const StackAllocator< U, SIZE > &  )
inline

◆ operator==()

template<typename T, unsigned int SIZE>
bool Bloomberg::quantum::StackAllocator< T, SIZE >::operator== ( const this_type ) const
inline

◆ select_on_container_copy_construction()

template<typename T, unsigned int SIZE>
static StackAllocator Bloomberg::quantum::StackAllocator< T, SIZE >::select_on_container_copy_construction ( const StackAllocator< T, SIZE > &  )
inlinestatic