lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
Classes | Public Types | Public Member Functions
lean::memory::heap_allocator< Element, Heap, Alignment > Class Template Reference

STL allocator heap adapter. More...

#include <heap_allocator.h>

List of all members.

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_typepointer
 Pointer type.
typedef value_typereference
 Reference type.
typedef const value_typeconst_pointer
 Pointer type.
typedef const value_typeconst_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_allocatoroperator= (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.

Detailed Description

template<class Element, class Heap = default_heap, size_t Alignment = alignof(Element)>
class lean::memory::heap_allocator< Element, Heap, Alignment >

STL allocator heap adapter.


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