2021-10-18 12:12:22 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#include <vector>
|
|
|
|
|
2021-10-20 20:44:43 +00:00
|
|
|
#include "simdjson/simdjson.h"
|
2021-10-18 12:12:22 +00:00
|
|
|
|
2021-10-19 08:28:13 +00:00
|
|
|
#include "byte_t.h"
|
|
|
|
|
|
|
|
class ram_t final {
|
2021-10-18 12:12:22 +00:00
|
|
|
private:
|
2021-10-19 08:28:13 +00:00
|
|
|
std::vector<byte_t> m_bytes;
|
2021-10-18 12:12:22 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
ram_t(simdjson::dom::array input);
|
|
|
|
|
2021-10-19 10:44:58 +00:00
|
|
|
void add(byte_t byte);
|
2021-10-19 08:28:13 +00:00
|
|
|
|
2021-10-18 16:19:28 +00:00
|
|
|
[[nodiscard]] auto begin() const noexcept { return m_bytes.begin(); }
|
|
|
|
[[nodiscard]] auto end() const noexcept { return m_bytes.end(); }
|
2021-10-18 12:12:22 +00:00
|
|
|
|
|
|
|
[[nodiscard]] auto size() const noexcept { return m_bytes.size(); }
|
|
|
|
|
2021-10-19 10:44:58 +00:00
|
|
|
[[nodiscard]] auto operator[](size_t idx) const noexcept { return m_bytes[idx]; }
|
2021-10-18 12:12:22 +00:00
|
|
|
};
|