A STL compatible allocator. More...
#include </home/runner/work/metall/metall/include/metall/stl_allocator.hpp>
Classes | |
struct | rebind |
Makes another allocator type for type T2. More... | |
Public Types | |
using | value_type = T |
using | pointer = typename std::pointer_traits< typename metall_manager_kernel_type::void_pointer >::template rebind< value_type > |
using | const_pointer = typename std::pointer_traits< pointer >::template rebind< const value_type > |
using | void_pointer = typename std::pointer_traits< pointer >::template rebind< void > |
using | const_void_pointer = typename std::pointer_traits< pointer >::template rebind< const void > |
using | difference_type = typename std::pointer_traits< pointer >::difference_type |
using | size_type = typename std::make_unsigned< difference_type >::type |
using | manager_kernel_type = metall_manager_kernel_type |
Public Member Functions | |
stl_allocator (manager_kernel_type *const *const pointer_manager_kernel_address) noexcept | |
template<typename T2 > | |
stl_allocator (stl_allocator< T2, manager_kernel_type > allocator_instance) noexcept | |
Construct a new instance using an instance that has a different T. | |
stl_allocator (const stl_allocator &other) noexcept=default | |
Copy constructor. | |
stl_allocator (stl_allocator &&other) noexcept=default | |
Move constructor. | |
~stl_allocator () noexcept=default | |
Destructor. | |
stl_allocator & | operator= (const stl_allocator &) noexcept=default |
Copy assign operator. | |
template<typename T2 > | |
stl_allocator & | operator= (const stl_allocator< T2, manager_kernel_type > &other) noexcept |
Copy assign operator for another T. | |
stl_allocator & | operator= (stl_allocator &&other) noexcept=default |
Move assign operator. | |
template<typename T2 > | |
stl_allocator & | operator= (stl_allocator< T2, manager_kernel_type > &&other) noexcept |
Move assign operator for another T. | |
pointer | allocate (const size_type n) const |
Allocates n * sizeof(T) bytes of storage. | |
void | deallocate (pointer ptr, const size_type size) const |
Deallocates the storage reference by the pointer ptr. | |
size_type | max_size () const noexcept |
The size of the theoretical maximum allocation size. | |
template<class... Args> | |
void | construct (const pointer &ptr, Args &&...args) const |
Constructs an object of T. | |
void | destroy (const pointer &ptr) const |
Deconstruct an object of T. | |
manager_kernel_type *const * | get_pointer_to_manager_kernel () const |
Returns a pointer that points to manager kernel. | |
A STL compatible allocator.
T | A object type. |
metall_manager_kernel_type | A manager kernel type. |
using metall::stl_allocator< T, metall_manager_kernel_type >::value_type = T |
using metall::stl_allocator< T, metall_manager_kernel_type >::pointer = typename std::pointer_traits< typename metall_manager_kernel_type::void_pointer>:: template rebind<value_type> |
using metall::stl_allocator< T, metall_manager_kernel_type >::const_pointer = typename std::pointer_traits<pointer>::template rebind<const value_type> |
using metall::stl_allocator< T, metall_manager_kernel_type >::void_pointer = typename std::pointer_traits<pointer>::template rebind<void> |
using metall::stl_allocator< T, metall_manager_kernel_type >::const_void_pointer = typename std::pointer_traits<pointer>::template rebind<const void> |
using metall::stl_allocator< T, metall_manager_kernel_type >::difference_type = typename std::pointer_traits<pointer>::difference_type |
using metall::stl_allocator< T, metall_manager_kernel_type >::size_type = typename std::make_unsigned<difference_type>::type |
using metall::stl_allocator< T, metall_manager_kernel_type >::manager_kernel_type = metall_manager_kernel_type |
|
inlinenoexcept |
|
inlinenoexcept |
Construct a new instance using an instance that has a different T.
|
defaultnoexcept |
Copy constructor.
|
defaultnoexcept |
Move constructor.
|
defaultnoexcept |
Destructor.
|
defaultnoexcept |
Copy assign operator.
|
inlinenoexcept |
Copy assign operator for another T.
|
defaultnoexcept |
Move assign operator.
|
inlinenoexcept |
Move assign operator for another T.
|
inline |
Allocates n * sizeof(T) bytes of storage.
n | The size to allocation |
|
inline |
Deallocates the storage reference by the pointer ptr.
ptr | A pointer to the storage |
size | The size of the storage |
|
inlinenoexcept |
The size of the theoretical maximum allocation size.
|
inline |
Constructs an object of T.
Args | The types of the constructor arguments |
ptr | A pointer to allocated storage |
args | The constructor arguments to use |
|
inline |
Deconstruct an object of T.
ptr | A pointer to the object |
|
inline |
Returns a pointer that points to manager kernel.