A STL compatible allocator.
More...
#include </home/runner/work/metall/metall/include/metall/stl_allocator.hpp>
template<typename T, typename metall_manager_kernel_type>
class metall::stl_allocator< T, metall_manager_kernel_type >
A STL compatible allocator.
- Template Parameters
-
T | A object type. |
metall_manager_kernel_type | A manager kernel type. |
- Warning
- This allocator does not define propagate_on_* types, as same as Boost.Interprocess. Those types are going to be std::false_type in std::allocator_traits. Therefore, this allocator is not propagated during containers' copy assignment, move assignment, or swap. This configuration enables users to copy containers between different Metall managers easier. On the other hand, performing the move assignment between two containers allocated by different Metall managers invokes copy operations instead of move operations. Also, swapping containers allocated by different Metall managers will result in undefined behavior.
- Examples
- allocator_aware_type.cpp, concurrent_map.cpp, multilevel_containers.cpp, string.cpp, string_map.cpp, and vector_of_vectors.cpp.
◆ value_type
template<typename T , typename metall_manager_kernel_type >
◆ pointer
template<typename T , typename metall_manager_kernel_type >
◆ const_pointer
template<typename T , typename metall_manager_kernel_type >
◆ void_pointer
template<typename T , typename metall_manager_kernel_type >
◆ const_void_pointer
template<typename T , typename metall_manager_kernel_type >
◆ difference_type
template<typename T , typename metall_manager_kernel_type >
◆ size_type
template<typename T , typename metall_manager_kernel_type >
◆ manager_kernel_type
template<typename T , typename metall_manager_kernel_type >
◆ stl_allocator() [1/4]
template<typename T , typename metall_manager_kernel_type >
◆ stl_allocator() [2/4]
template<typename T , typename metall_manager_kernel_type >
template<typename T2 >
Construct a new instance using an instance that has a different T.
◆ stl_allocator() [3/4]
template<typename T , typename metall_manager_kernel_type >
◆ stl_allocator() [4/4]
template<typename T , typename metall_manager_kernel_type >
◆ ~stl_allocator()
template<typename T , typename metall_manager_kernel_type >
◆ operator=() [1/4]
template<typename T , typename metall_manager_kernel_type >
◆ operator=() [2/4]
template<typename T , typename metall_manager_kernel_type >
template<typename T2 >
Copy assign operator for another T.
◆ operator=() [3/4]
template<typename T , typename metall_manager_kernel_type >
◆ operator=() [4/4]
template<typename T , typename metall_manager_kernel_type >
template<typename T2 >
Move assign operator for another T.
◆ allocate()
template<typename T , typename metall_manager_kernel_type >
Allocates n * sizeof(T) bytes of storage.
- Parameters
-
- Returns
- Returns a pointer
◆ deallocate()
template<typename T , typename metall_manager_kernel_type >
Deallocates the storage reference by the pointer ptr.
- Parameters
-
ptr | A pointer to the storage |
size | The size of the storage |
◆ max_size()
template<typename T , typename metall_manager_kernel_type >
The size of the theoretical maximum allocation size.
- Returns
- The size of the theoretical maximum allocation size
◆ construct()
template<typename T , typename metall_manager_kernel_type >
template<class... Args>
Constructs an object of T.
- Template Parameters
-
Args | The types of the constructor arguments |
- Parameters
-
ptr | A pointer to allocated storage |
args | The constructor arguments to use |
◆ destroy()
template<typename T , typename metall_manager_kernel_type >
Deconstruct an object of T.
- Parameters
-
ptr | A pointer to the object |
◆ get_pointer_to_manager_kernel()
template<typename T , typename metall_manager_kernel_type >
Returns a pointer that points to manager kernel.
- Returns
- A pointer that points to manager kernel
The documentation for this class was generated from the following file: