QuantumLibrary
Bloomberg::quantum::HeapAllocator< T > Struct Template Reference

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

#include <quantum_heap_allocator.h>

Inheritance diagram for Bloomberg::quantum::HeapAllocator< T >:
Bloomberg::quantum::ContiguousPoolManager< T >

Classes

struct  rebind
 

Public Types

typedef HeapAllocator< 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::ptrdiff_t difference_type
 
typedef std::true_type propagate_on_container_move_assignment
 
typedef std::false_type propagate_on_container_copy_assignment
 
typedef std::true_type propagate_on_container_swap
 
typedef std::true_type is_always_equal
 
typedef std::false_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

 HeapAllocator (index_type size)
 
 HeapAllocator (const this_type &other)
 
 HeapAllocator (this_type &&other)
 
HeapAllocatoroperator= (const this_type &)
 
HeapAllocatoroperator= (this_type &&other)
 
 ~HeapAllocator ()
 
template<typename U >
 HeapAllocator (const HeapAllocator< U > &other)
 
template<typename U >
HeapAllocatoroperator= (const HeapAllocator< U > &)
 
bool operator== (const this_type &) const
 
bool operator!= (const this_type &) const
 
index_type size () 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 HeapAllocator select_on_container_copy_construction (const HeapAllocator &other)
 

Detailed Description

template<typename T>
struct Bloomberg::quantum::HeapAllocator< T >

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

Template Parameters
TThe type to allocate.
Note
This allocator is thread safe. For internal use only.

Member Typedef Documentation

◆ aligned_type

template<typename T>
typedef storage_type::type Bloomberg::quantum::HeapAllocator< T >::aligned_type

◆ const_pointer

template<typename T>
typedef const value_type* Bloomberg::quantum::HeapAllocator< T >::const_pointer

◆ const_reference

template<typename T>
typedef const value_type& Bloomberg::quantum::HeapAllocator< T >::const_reference

◆ default_constructor

template<typename T>
typedef std::false_type Bloomberg::quantum::HeapAllocator< T >::default_constructor

◆ difference_type

template<typename T>
typedef std::ptrdiff_t Bloomberg::quantum::HeapAllocator< T >::difference_type

◆ index_type

template<typename T>
typedef uint16_t Bloomberg::quantum::HeapAllocator< T >::index_type

◆ is_always_equal

template<typename T>
typedef std::true_type Bloomberg::quantum::HeapAllocator< T >::is_always_equal

◆ pointer

template<typename T>
typedef value_type* Bloomberg::quantum::HeapAllocator< T >::pointer

◆ propagate_on_container_copy_assignment

template<typename T>
typedef std::false_type Bloomberg::quantum::HeapAllocator< T >::propagate_on_container_copy_assignment

◆ propagate_on_container_move_assignment

template<typename T>
typedef std::true_type Bloomberg::quantum::HeapAllocator< T >::propagate_on_container_move_assignment

◆ propagate_on_container_swap

template<typename T>
typedef std::true_type Bloomberg::quantum::HeapAllocator< T >::propagate_on_container_swap

◆ reference

template<typename T>
typedef value_type& Bloomberg::quantum::HeapAllocator< T >::reference

◆ size_type

template<typename T>
typedef size_t Bloomberg::quantum::HeapAllocator< T >::size_type

◆ storage_type

template<typename T>
typedef std::aligned_storage<sizeof(value_type), alignof(value_type)> Bloomberg::quantum::HeapAllocator< T >::storage_type

◆ this_type

template<typename T>
typedef HeapAllocator<T> Bloomberg::quantum::HeapAllocator< T >::this_type

◆ value_type

template<typename T>
typedef T Bloomberg::quantum::HeapAllocator< T >::value_type

Constructor & Destructor Documentation

◆ HeapAllocator() [1/4]

template<typename T>
Bloomberg::quantum::HeapAllocator< T >::HeapAllocator ( index_type  size)
inline

◆ HeapAllocator() [2/4]

template<typename T>
Bloomberg::quantum::HeapAllocator< T >::HeapAllocator ( const this_type other)
inline

◆ HeapAllocator() [3/4]

template<typename T>
Bloomberg::quantum::HeapAllocator< T >::HeapAllocator ( this_type &&  other)
inline

◆ ~HeapAllocator()

template<typename T>
Bloomberg::quantum::HeapAllocator< T >::~HeapAllocator ( )
inline

◆ HeapAllocator() [4/4]

template<typename T>
template<typename U >
Bloomberg::quantum::HeapAllocator< T >::HeapAllocator ( const HeapAllocator< U > &  other)
inline

Member Function Documentation

◆ operator!=()

template<typename T>
bool Bloomberg::quantum::HeapAllocator< T >::operator!= ( const this_type ) const
inline

◆ operator=() [1/3]

template<typename T>
HeapAllocator& Bloomberg::quantum::HeapAllocator< T >::operator= ( const this_type )
inline

◆ operator=() [2/3]

template<typename T>
HeapAllocator& Bloomberg::quantum::HeapAllocator< T >::operator= ( this_type &&  other)
inline

◆ operator=() [3/3]

template<typename T>
template<typename U >
HeapAllocator& Bloomberg::quantum::HeapAllocator< T >::operator= ( const HeapAllocator< U > &  )
inline

◆ operator==()

template<typename T>
bool Bloomberg::quantum::HeapAllocator< T >::operator== ( const this_type ) const
inline

◆ select_on_container_copy_construction()

template<typename T>
static HeapAllocator Bloomberg::quantum::HeapAllocator< T >::select_on_container_copy_construction ( const HeapAllocator< T > &  other)
inlinestatic

◆ size()

template<typename T>
index_type Bloomberg::quantum::HeapAllocator< T >::size ( ) const
inline