Simulated physical RAM — a linear array of Block cells.
More...
#include <physical_memory.h>
|
| std::unique_ptr< Impl > | impl_ |
Simulated physical RAM — a linear array of Block cells.
Supports read, write, clear, and bulk operations for loading/saving code segments (swap in/out).
Definition at line 17 of file physical_memory.h.
◆ PhysicalMemory() [1/3]
| contur::PhysicalMemory::PhysicalMemory |
( |
std::size_t | cellCount | ) |
|
|
explicit |
Constructs physical memory with the given number of cells.
- Parameters
-
| cellCount | Total addressable cells (each holds one Block). |
◆ ~PhysicalMemory()
| contur::PhysicalMemory::~PhysicalMemory |
( |
| ) |
|
|
override |
◆ PhysicalMemory() [2/3]
| contur::PhysicalMemory::PhysicalMemory |
( |
const PhysicalMemory & | | ) |
|
|
delete |
◆ PhysicalMemory() [3/3]
| contur::PhysicalMemory::PhysicalMemory |
( |
PhysicalMemory && | | ) |
|
|
noexcept |
◆ clear()
| void contur::PhysicalMemory::clear |
( |
| ) |
|
|
overridevirtual |
Clears all memory cells to default (Nop) blocks.
Implements contur::IMemory.
◆ clearRange()
| Result< void > contur::PhysicalMemory::clearRange |
( |
MemoryAddress | startAddress, |
|
|
std::size_t | count ) |
|
nodiscard |
Clears a range of memory cells to default blocks.
- Parameters
-
| startAddress | The base address to begin clearing. |
| count | Number of blocks to clear. |
- Returns
- Success or an error if any address is out of range.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ read()
Reads a Block from the given address.
- Parameters
-
| address | The memory address to read from. |
- Returns
- The Block at the address, or an error if the address is invalid.
Implements contur::IMemory.
◆ readRange()
| Result< std::vector< Block > > contur::PhysicalMemory::readRange |
( |
MemoryAddress | startAddress, |
|
|
std::size_t | count ) const |
|
nodiscard |
Reads a contiguous sequence of blocks starting at the given address.
- Parameters
-
| startAddress | The base address to begin reading. |
| count | Number of blocks to read. |
- Returns
- The blocks, or an error if any address is out of range.
◆ size()
| std::size_t contur::PhysicalMemory::size |
( |
| ) |
const |
|
nodiscardoverridevirtualnoexcept |
◆ write()
Writes a Block to the given address.
- Parameters
-
| address | The memory address to write to. |
| block | The Block to store. |
- Returns
- Success or an error if the address is invalid.
Implements contur::IMemory.
◆ writeRange()
Writes a contiguous sequence of blocks starting at the given address.
- Parameters
-
| startAddress | The base address to begin writing. |
| blocks | The blocks to write sequentially. |
- Returns
- Success or an error if any address is out of range.
◆ impl_
| std::unique_ptr<Impl> contur::PhysicalMemory::impl_ |
|
private |
The documentation for this class was generated from the following file: