2021-10-19 09:28:13 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
2021-10-20 21:44:43 +01:00
|
|
|
#include "simdjson/simdjson.h"
|
2021-10-19 09:28:13 +01:00
|
|
|
|
|
|
|
class byte_t final {
|
|
|
|
private:
|
2021-10-20 21:05:43 +01:00
|
|
|
simdjson::dom::array m_raw;
|
|
|
|
|
2021-10-19 09:28:13 +01:00
|
|
|
public:
|
|
|
|
byte_t(simdjson::dom::element input) noexcept;
|
|
|
|
byte_t(simdjson::dom::array input) noexcept;
|
|
|
|
|
2021-10-20 21:05:43 +01:00
|
|
|
[[nodiscard]] auto address() const noexcept { return (uint16_t)(int64_t)*m_raw.begin(); }
|
|
|
|
[[nodiscard]] auto value() const noexcept { return (uint8_t)(int64_t)m_raw.at(1); }
|
2021-10-19 09:28:13 +01:00
|
|
|
};
|