momo  3.9
momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams > Class Template Reference

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_typepointer
 
typedef const value_typeconst_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_allocatoroperator= (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
 
bool operator== (const unsynchronized_pool_allocator &alloc) const noexcept
 
bool operator!= (const unsynchronized_pool_allocator &alloc) const noexcept
 

Protected Member Functions

 unsynchronized_pool_allocator (const std::shared_ptr< MemPool > &memPool) noexcept
 

Detailed Description

template<typename TValue, typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
class momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >

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.

Member Typedef Documentation

◆ base_allocator_type

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
typedef TBaseAllocator momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::base_allocator_type

◆ const_pointer

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
typedef const value_type* momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::const_pointer

◆ difference_type

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
typedef ptrdiff_t momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::difference_type

◆ mem_pool_params

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
typedef TMemPoolParams momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::mem_pool_params

◆ pointer

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
typedef value_type* momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::pointer

◆ propagate_on_container_copy_assignment

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
typedef std::false_type momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::propagate_on_container_copy_assignment

◆ propagate_on_container_move_assignment

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
typedef std::true_type momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::propagate_on_container_move_assignment

◆ propagate_on_container_swap

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
typedef std::true_type momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::propagate_on_container_swap

◆ size_type

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
typedef size_t momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::size_type

◆ value_type

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
typedef TValue momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::value_type

Constructor & Destructor Documentation

◆ unsynchronized_pool_allocator() [1/3]

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::unsynchronized_pool_allocator ( const base_allocator_type alloc = base_allocator_type())
inlineexplicit

◆ unsynchronized_pool_allocator() [2/3]

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::unsynchronized_pool_allocator ( const unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams > &  alloc)
inlinenoexcept

◆ ~unsynchronized_pool_allocator()

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::~unsynchronized_pool_allocator ( )
default

◆ unsynchronized_pool_allocator() [3/3]

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::unsynchronized_pool_allocator ( const std::shared_ptr< MemPool > &  memPool)
inlineexplicitprotectednoexcept

Member Function Documentation

◆ allocate()

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
MOMO_NODISCARD pointer momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::allocate ( size_type  count)
inline

◆ construct()

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
template<typename Value , typename... ValueArgs>
void momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::construct ( Value *  ptr,
ValueArgs &&...  valueArgs 
)
inline

◆ deallocate()

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
void momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::deallocate ( pointer  ptr,
size_type  count 
)
inlinenoexcept

◆ destroy()

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
template<class Value >
void momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::destroy ( Value *  ptr)
inlinenoexcept

◆ get_base_allocator()

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
base_allocator_type momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::get_base_allocator ( ) const
inlinenoexcept

◆ operator unsynchronized_pool_allocator< Value, base_allocator_type, mem_pool_params >()

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
template<class Value >
momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::operator unsynchronized_pool_allocator< Value, base_allocator_type, mem_pool_params > ( ) const
inlinenoexcept

◆ operator!=()

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
bool momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::operator!= ( const unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams > &  alloc) const
inlinenoexcept

◆ operator=()

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
unsynchronized_pool_allocator& momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::operator= ( const unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams > &  alloc)
inlinenoexcept

◆ operator==()

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
bool momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::operator== ( const unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams > &  alloc) const
inlinenoexcept

◆ select_on_container_copy_construction()

template<typename TValue , typename TBaseAllocator = std::allocator<unsigned char>, typename TMemPoolParams = MemPoolParams<>>
unsynchronized_pool_allocator momo::stdish::unsynchronized_pool_allocator< TValue, TBaseAllocator, TMemPoolParams >::select_on_container_copy_construction ( ) const
inlinenoexcept

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