Wrapper around a block of memory, containing both the size and the address of the memory block.
More...
#include <memory_block.hpp>
Wrapper around a block of memory, containing both the size and the address of the memory block.
Definition at line 60 of file memory_block.hpp.
◆ memory_block() [1/4]
constexpr bit::memory::memory_block::memory_block |
( |
nullblock_t |
| ) |
|
|
noexcept |
Constructs a memory block pointing to null with 0 size.
◆ memory_block() [2/4]
constexpr bit::memory::memory_block::memory_block |
( |
void * |
data, |
|
|
std::size_t |
size |
|
) |
| |
|
noexcept |
Constructs a memory_block at the specified memory address, data
, with the specified size size
.
- Parameters
-
data | The memory address to start the block |
size | The size of the memory block |
◆ memory_block() [3/4]
constexpr bit::memory::memory_block::memory_block |
( |
const memory_block & |
other | ) |
|
|
defaultnoexcept |
◆ memory_block() [4/4]
constexpr bit::memory::memory_block::memory_block |
( |
memory_block && |
other | ) |
|
|
defaultnoexcept |
◆ contains()
bool bit::memory::memory_block::contains |
( |
const void * |
ptr | ) |
const |
|
noexcept |
Evaluates whether ptr
exists within this memory_block.
- Parameters
-
ptr | the pointer to evaluate |
- Returns
true
whether ptr
◆ data()
constexpr void* bit::memory::memory_block::data |
( |
| ) |
const |
|
noexcept |
Retrieves the pointer to the data.
- Returns
- the pointer to the data
◆ end_address()
constexpr void* bit::memory::memory_block::end_address |
( |
| ) |
const |
|
noexcept |
Retrieves the end address of this memory block.
- Note
- That the end address is 1 past the end of the memory block
- Returns
- the pointer to the end of the data block
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ size()
constexpr std::size_t bit::memory::memory_block::size |
( |
| ) |
const |
|
noexcept |
Retrieves the size of a data.
- Returns
- the size of the data
◆ start_address()
constexpr void* bit::memory::memory_block::start_address |
( |
| ) |
const |
|
noexcept |
Retrieves the start address of this memory block.
This is the same as data()
- Returns
- the pointer to the data block
◆ swap()
void bit::memory::memory_block::swap |
( |
memory_block & |
other | ) |
|
|
noexcept |
Swaps this memory_block with other
.
- Parameters
-
other | the other entry to swap |
The documentation for this class was generated from the following file: