#include <OnixS/CME/MDH/MemoryPool.h>
Classes | |
| struct | rebind |
Public Types | |
| using | value_type = Object |
| using | pointer = Object* |
| using | const_pointer = const Object* |
| using | reference = Object& |
| using | const_reference = const Object& |
| using | size_type = std::size_t |
| using | difference_type = std::ptrdiff_t |
Public Member Functions | |
| MemoryPoolAllocator () noexcept | |
| MemoryPoolAllocator (MemoryPool &memoryPool) noexcept | |
| MemoryPoolAllocator (const MemoryPoolAllocator &other) noexcept=default | |
| template<class Other> | |
| MemoryPoolAllocator (const MemoryPoolAllocator< Other > &other) noexcept | |
| ~MemoryPoolAllocator () noexcept=default | |
| MemoryPool & | memoryPool () const noexcept |
| pointer | address (reference obj) const noexcept |
| const_pointer | address (const_reference x) const noexcept |
| pointer | allocate (size_type qty) |
| void | deallocate (pointer block, size_type qty) noexcept |
| template<class Item, class... Args> | |
| void | construct (Item *block, Args &&... args) |
| void | destroy (pointer obj) noexcept |
| size_type | max_size () const noexcept |
| MemoryPoolAllocator & | operator= (const MemoryPoolAllocator &other) noexcept=default |
| template<class Other> | |
| MemoryPoolAllocator & | operator= (const MemoryPoolAllocator< Other > &other) noexcept |
Friends | |
| template<class> | |
| class | MemoryPoolAllocator |
| template<class LeftObject, class RightObject> | |
| bool | operator== (const MemoryPoolAllocator< LeftObject > &left, const MemoryPoolAllocator< RightObject > &right) noexcept |
| Object | Object type allocated by this adapter. Allocation requires alignment no greater than alignof(std::max_align_t). |
The adapter holds a non-owning pointer to its pool. The pool must outlive the allocator and every container or allocation that uses it.
Definition at line 102 of file MemoryPool.h.
| using const_pointer = const Object* |
Read-only pointer to an allocated object.
Definition at line 112 of file MemoryPool.h.
| using const_reference = const Object& |
Read-only reference to an allocated object.
Definition at line 118 of file MemoryPool.h.
| using difference_type = std::ptrdiff_t |
Signed type used for pointer differences.
Definition at line 124 of file MemoryPool.h.
| using pointer = Object* |
Mutable pointer to an allocated object.
Definition at line 109 of file MemoryPool.h.
| using reference = Object& |
Mutable reference to an allocated object.
Definition at line 115 of file MemoryPool.h.
| using size_type = std::size_t |
Unsigned type used for object counts.
Definition at line 121 of file MemoryPool.h.
| using value_type = Object |
Type of object allocated by this adapter.
Definition at line 106 of file MemoryPool.h.
|
inlinenoexcept |
Creates an allocator that is not associated with a pool.
Definition at line 138 of file MemoryPool.h.
|
inlinenoexcept |
Associates the allocator with a pool.
| memoryPool | Pool used for subsequent allocations and deallocations. |
memoryPool. Definition at line 146 of file MemoryPool.h.
|
defaultnoexcept |
Copies the source allocator's pool association.
| other | Source allocator. |
|
inlinenoexcept |
Copies a compatible allocator's pool association.
| Other | Object type allocated by the source allocator. |
| other | Source allocator. |
Definition at line 159 of file MemoryPool.h.
|
defaultnoexcept |
Destroys the adapter without releasing its pool or outstanding storage.
|
inlinenoexcept |
Obtains the address of a read-only object.
| x | Object whose address is requested. |
x. Definition at line 189 of file MemoryPool.h.
Obtains the address of a mutable object.
| obj | Object whose address is requested. |
obj. Definition at line 180 of file MemoryPool.h.
Allocates uninitialized storage for a sequence of objects.
| qty | Number of objects for which storage is required. |
| std::length_error | If qty exceeds max_size(), or if the resulting allocation or configured chunk is too large. |
| std::bad_alloc | If storage cannot be allocated. |
Definition at line 203 of file MemoryPool.h.
|
inline |
Constructs an object in allocated storage.
| Item | Object type to construct. |
| Args | Constructor argument types. |
| block | Address of suitably aligned uninitialized storage. |
| args | Arguments forwarded to the object's constructor. |
| Any | exception thrown by the selected constructor. |
Definition at line 239 of file MemoryPool.h.
Returns storage to the associated pool.
| block | Pointer returned by allocate(), or nullptr. |
| qty | Object count supplied for allocator compatibility; it is not inspected. |
block was allocated by the associated pool. Definition at line 223 of file MemoryPool.h.
|
inlinenoexcept |
Destroys an object without deallocating its storage.
| obj | Object previously constructed in allocated storage. |
Definition at line 247 of file MemoryPool.h.
|
inlinenoexcept |
Computes the largest object count representable as a byte size.
Definition at line 261 of file MemoryPool.h.
|
inlinenoexcept |
Accesses the associated pool.
Definition at line 171 of file MemoryPool.h.
|
defaultnoexcept |
Replaces this allocator's pool association with the source association.
| other | Source allocator. |
|
inlinenoexcept |
Replaces this allocator's pool association with a compatible source association.
| Other | Object type allocated by the source allocator. |
| other | Source allocator. |
Definition at line 276 of file MemoryPool.h.
|
friend |
Definition at line 284 of file MemoryPool.h.
|
friend |