lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
|
STL allocator heap adapter. More...
#include <heap_allocator.h>
Classes | |
struct | rebind |
Allows for the creation of differently-typed equivalent allocators. More... | |
Public Types | |
typedef Heap | heap_type |
Heap adapted by this heap allocator. | |
typedef strip_const< Element > ::type | value_type |
Value type. | |
typedef value_type * | pointer |
Pointer type. | |
typedef value_type & | reference |
Reference type. | |
typedef const value_type * | const_pointer |
Pointer type. | |
typedef const value_type & | const_reference |
Reference type. | |
typedef heap_type::size_type | size_type |
Size type. | |
typedef ptrdiff_t | difference_type |
Pointer difference type. | |
Public Member Functions | |
LEAN_INLINE | heap_allocator () |
Default constructor. | |
template<class Other > | |
LEAN_INLINE | heap_allocator (const heap_allocator< Other, Heap, Alignment > &right) |
Copy constructor. | |
template<class Other > | |
LEAN_INLINE heap_allocator & | operator= (const heap_allocator< Other, Heap, Alignment > &right) |
Assignment operator. | |
LEAN_INLINE pointer | allocate (size_type count) |
Allocates the given number of elements. | |
LEAN_INLINE pointer | allocate (size_type count, const void *) |
Allocates the given amount of memory. | |
LEAN_INLINE void | deallocate (pointer ptr, size_type) |
Allocates the given amount of memory. | |
LEAN_INLINE void | construct (pointer ptr, const value_type &value) |
Constructs a new element from the given value at the given pointer. | |
template<class Other > | |
LEAN_INLINE void | construct (pointer ptr, const Other &value) |
Constructs a new element from the given value at the given pointer. | |
LEAN_INLINE void | destroy (pointer ptr) |
Destructs an element at the given pointer. | |
LEAN_INLINE pointer | address (reference value) const |
Gets the address of the given element. | |
LEAN_INLINE const_pointer | address (const_reference value) const |
Gets the address of the given element. | |
LEAN_INLINE size_t | max_size () const |
Estimates the maximum number of elements that may be constructed. |
STL allocator heap adapter.