20#ifndef ORES_COMMS_MESSAGING_READER_HPP
21#define ORES_COMMS_MESSAGING_READER_HPP
28#include <boost/uuid/uuid_io.hpp>
29#include "ores.comms/messaging/message_types.hpp"
41 static std::expected<std::uint16_t, error_code>
47 static std::expected<std::uint32_t, error_code>
53 static std::expected<std::int64_t, error_code>
60 const boost::uuids::uuid& uuid);
65 static std::expected<std::string, error_code>
71 static std::expected<boost::uuids::uuid, error_code>
72 read_uuid(std::span<const std::byte>& data);
77 static std::expected<bool, error_code>
78 read_bool(std::span<const std::byte>& data);
Contains messaging related infrastructure in the comms library.
Definition compression.hpp:29
Helper to read network data.
Definition reader.hpp:36
static std::expected< boost::uuids::uuid, error_code > read_uuid(std::span< const std::byte > &data)
Helper to read a UUID (16 bytes).
Definition reader.cpp:83
static std::expected< std::uint16_t, error_code > read_uint16(std::span< const std::byte > &data)
Helper to read a 16-bit integer in network byte order.
Definition reader.cpp:27
static std::expected< std::uint32_t, error_code > read_uint32(std::span< const std::byte > &data)
Helper to read a 32-bit integer in network byte order.
Definition reader.cpp:38
static std::expected< bool, error_code > read_bool(std::span< const std::byte > &data)
Helper to read a boolean (1 byte).
Definition reader.cpp:99
static std::expected< std::int64_t, error_code > read_int64(std::span< const std::byte > &data)
Helper to read a 64-bit integer in network byte order.
Definition reader.cpp:51
static void write_uuid(std::vector< std::byte > &buffer, const boost::uuids::uuid &uuid)
Helper to write a UUID (16 bytes).
static std::expected< std::string, error_code > read_string(std::span< const std::byte > &data)
Helper to read a string with 16-bit length prefix.
Definition reader.cpp:68