momo
3.10
|
Allocator with a pool of memory for containers like std::list
, std::forward_list
, std::map
, std::unordered_map
. It makes no sense to use this allocator for classes momo::stdish
.
More...
#include <pool_allocator.h>
Public Types | |
typedef TValue | value_type |
typedef TBaseAllocator | base_allocator_type |
typedef TMemPoolParams | mem_pool_params |
typedef value_type * | pointer |
typedef const value_type * | const_pointer |
typedef size_t | size_type |
typedef ptrdiff_t | difference_type |
typedef std::false_type | propagate_on_container_copy_assignment |
typedef std::true_type | propagate_on_container_move_assignment |
typedef std::true_type | propagate_on_container_swap |
Public Member Functions | |
unsynchronized_pool_allocator (const base_allocator_type &alloc=base_allocator_type()) | |
unsynchronized_pool_allocator (const unsynchronized_pool_allocator &alloc) noexcept | |
~unsynchronized_pool_allocator ()=default | |
unsynchronized_pool_allocator & | operator= (const unsynchronized_pool_allocator &alloc) noexcept |
template<class Value > | |
operator unsynchronized_pool_allocator< Value, base_allocator_type, mem_pool_params > () const noexcept | |
base_allocator_type | get_base_allocator () const noexcept |
unsynchronized_pool_allocator | select_on_container_copy_construction () const noexcept |
MOMO_NODISCARD pointer | allocate (size_type count) |
void | deallocate (pointer ptr, size_type count) noexcept |
template<typename Value , typename... ValueArgs> | |
void | construct (Value *ptr, ValueArgs &&... valueArgs) |
template<class Value > | |
void | destroy (Value *ptr) noexcept |
Protected Member Functions | |
unsynchronized_pool_allocator (const std::shared_ptr< MemPool > &memPool) noexcept | |
Friends | |
bool | operator== (const unsynchronized_pool_allocator &left, const unsynchronized_pool_allocator &right) noexcept |
bool | operator!= (const unsynchronized_pool_allocator &left, const unsynchronized_pool_allocator &right) noexcept |
Allocator with a pool of memory for containers like std::list
, std::forward_list
, std::map
, std::unordered_map
. It makes no sense to use this allocator for classes momo::stdish
.
Each copy of the container keeps its own memory pool. Memory is released not only after destruction of the object, but also in case of removal sufficient number of items.
typedef TBaseAllocator momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::base_allocator_type |
typedef const value_type* momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::const_pointer |
typedef ptrdiff_t momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::difference_type |
typedef TMemPoolParams momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::mem_pool_params |
typedef value_type* momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::pointer |
typedef std::false_type momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::propagate_on_container_copy_assignment |
typedef std::true_type momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::propagate_on_container_move_assignment |
typedef std::true_type momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::propagate_on_container_swap |
typedef size_t momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::size_type |
typedef TValue momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::value_type |
|
inlineexplicit |
|
inlinenoexcept |
|
default |
|
inlineexplicitprotectednoexcept |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
friend |
|
friend |