A type erased view of allocators that satisfy the BlockAllocator concept.
More...
#include <block_allocator_reference.hpp>
A type erased view of allocators that satisfy the BlockAllocator concept.
This view is non-owning, and thus does not participate in the lifetime of a given allocator.
- Satisfies
- BlockAllocator
Definition at line 65 of file block_allocator_reference.hpp.
◆ block_allocator_reference() [1/3]
template<typename BlockAllocator , typename = std::enable_if_t<is_block_allocator<BlockAllocator>::value && !std::is_same<block_allocator_reference,BlockAllocator>::value>>
bit::memory::block_allocator_reference::block_allocator_reference |
( |
BlockAllocator & |
allocator | ) |
|
|
noexcept |
Constructs a block allocator by type erasing the underlying allocator.
- Parameters
-
allocator | the block allocator to type-erase |
◆ block_allocator_reference() [2/3]
Move-constructs a block_allocator from an existing one.
- Parameters
-
other | the other allocator to move |
◆ block_allocator_reference() [3/3]
Copy-constructs a block_allocator from an existing one.
- Parameters
-
other | the other allocator to copy |
◆ allocate_block()
owner<memory_block> bit::memory::block_allocator_reference::allocate_block |
( |
| ) |
|
Allocates a block from the underlying block allocator.
- Returns
- the allocated memory block
◆ deallocate_block()
void bit::memory::block_allocator_reference::deallocate_block |
( |
owner< memory_block > |
block | ) |
|
Deallocates a block from the underlying block allocatore.
- Parameters
-
block | the block to deallocate |
◆ info()
Gets information about this allocator.
- Returns
- the allocator information
◆ next_block_size()
std::size_t bit::memory::block_allocator_reference::next_block_size |
( |
| ) |
const |
|
noexcept |
Gets the next available block size for this allocator.
- Returns
- the next block size
◆ operator=() [1/2]
Move-assigns a block_allocator from an existing one.
- Parameters
-
other | the other allocator to move |
- Returns
- reference to
(*this)
◆ operator=() [2/2]
Copy-assigns a block_allocator from an existing one.
- Parameters
-
other | the other allocator to copy |
- Returns
- reference to
(*this)
◆ make_stateless_block_allocator_reference
Makes a block_allocator_reference that refers to a stateless block allocator.
This creates a reference to any stateless block allocator, even though different instances may have different underlying addresses.
- Template Parameters
-
StatelessBlockAllocator | the type of a stateless block allocator |
The documentation for this class was generated from the following file: