6#include "protocol/PacketReader.hpp"
7#include "protocol/PacketWriter.hpp"
9namespace rtype::protocol {
23 requires std::is_trivially_copyable_v<T>
25 return writer.
writeBytes(
reinterpret_cast<const std::uint8_t *
>(&payload),
37 requires std::is_trivially_copyable_v<T>
39 return reader.
readBytes(
reinterpret_cast<std::uint8_t *
>(&payload),
Bounds checked reader of big-endian values over a byte buffer.
Definition PacketReader.hpp:15
bool readBytes(std::uint8_t *destination, std::size_t size)
Copies raw bytes out of the buffer.
Definition PacketReader.cpp:49
Growable buffer of big-endian values, capped at MAX_PAYLOAD_SIZE.
Definition PacketWriter.hpp:16
bool writeBytes(const std::uint8_t *data, std::size_t size)
Appends raw bytes.
Definition PacketWriter.cpp:40
bool readPayload(PacketReader &reader, T &payload)
Reads the raw bytes of a padding free payload struct.
Definition PayloadCodec.hpp:38
bool writePayload(PacketWriter &writer, const T &payload)
Appends the raw bytes of a padding free payload struct.
Definition PayloadCodec.hpp:24