22 byte read(
unsigned address)
override;
23 void write(
unsigned address,
byte value)
override;
38 [[nodiscard]]
const byte&
operator[](
size_t addr)
const {
44 [[nodiscard]]
auto size()
const {
return sz; }
45 [[nodiscard]]
auto data() {
return ram.
data(); }
46 [[nodiscard]]
auto data()
const {
return ram.
data(); }
48 [[nodiscard]]
auto begin()
const {
return ram.
data(); }
49 [[nodiscard]]
auto end() {
return ram.
data() + sz; }
50 [[nodiscard]]
auto end()
const {
return ram.
data() + sz; }
52 [[nodiscard]]
const std::string&
getName()
const;
53 void clear(
byte c = 0xff);
55 template<
typename Archive>
56 void serialize(Archive& ar,
unsigned version);
62 const std::optional<RamDebuggable> debuggable;
This class manages the lifetime of a block of memory.
const T * data() const
Returns pointer to the start of the memory buffer.
byte read(unsigned address) override
void write(unsigned address, byte value) override
const byte & operator[](size_t addr) const
void serialize(Archive &ar, unsigned version)
const std::string & getName() const
byte & operator[](size_t addr)
This file implemented 3 utility functions: