34 [[nodiscard]] std::
size_t size() const noexcept override;
Abstract interface for linear addressable memory.
void clear() override
Clears all memory cells to default (Nop) blocks.
Result< void > writeRange(MemoryAddress startAddress, const std::vector< Block > &blocks)
Writes a contiguous sequence of blocks starting at the given address.
PhysicalMemory(PhysicalMemory &&) noexcept
std::unique_ptr< Impl > impl_
std::size_t size() const noexcept override
Returns the total number of addressable cells.
Result< Block > read(MemoryAddress address) const override
Reads a Block from the given address.
~PhysicalMemory() override
Result< void > write(MemoryAddress address, const Block &block) override
Writes a Block to the given address.
PhysicalMemory(const PhysicalMemory &)=delete
Result< void > clearRange(MemoryAddress startAddress, std::size_t count)
Clears a range of memory cells to default blocks.
PhysicalMemory(std::size_t cellCount)
Constructs physical memory with the given number of cells.
Result< std::vector< Block > > readRange(MemoryAddress startAddress, std::size_t count) const
Reads a contiguous sequence of blocks starting at the given address.
PhysicalMemory & operator=(const PhysicalMemory &)=delete
A result type that holds either a success value of type T or an ErrorCode.
IMemory interface — abstract linear addressable memory.
std::uint32_t MemoryAddress
Represents a memory address (physical or virtual).
A single memory cell in the simulated architecture.