20#ifndef ORES_COMMS_MESSAGING_MESSAGE_HANDLER_HPP
21#define ORES_COMMS_MESSAGING_MESSAGE_HANDLER_HPP
27#include <boost/asio/awaitable.hpp>
28#include "ores.comms/messaging/message_types.hpp"
45 auto type_value =
static_cast<std::uint16_t
>(type);
46 return type_value >= min && type_value <= max;
53 return max < other.min;
78 virtual boost::asio::awaitable<std::expected<std::vector<std::byte>, error_code>>
80 const std::string& remote_address) = 0;
Contains messaging related infrastructure in the comms library.
Definition compression.hpp:29
Range of message types handled by a subsystem.
Definition message_handler.hpp:37
bool operator<(const message_type_range &other) const
Comparison operator for use in ordered containers.
Definition message_handler.hpp:52
bool contains(message_type type) const
Check if a message type falls within this range.
Definition message_handler.hpp:44
Abstract interface for handling messages from a subsystem.
Definition message_handler.hpp:66
virtual boost::asio::awaitable< std::expected< std::vector< std::byte >, error_code > > handle_message(message_type type, std::span< const std::byte > payload, const std::string &remote_address)=0
Handle a message and produce a response payload.