18 std::vector<protocol::OutMessage>
result;
29 using T = std::decay_t<
decltype(
msg)>;
35 }
catch(
const std::exception&
e) {
41std::optional<MessageHandler::any_handler_function_t>
45 [
this](
auto&&
value) -> std::optional<any_handler_function_t> {
46 using T = std::decay_t<
decltype(
value)>;
51 return std::make_optional<any_handler_function_t>(*
res);
std::function< handling_function_response_t(const irsol::types::client_id_t &, T &&)> handler_function_t
handling_function_response_t handle(const irsol::types::client_id_t &clientId, protocol::InMessage &&message) const
Dispatches an incoming message to the correct user-defined handler.
std::optional< any_handler_function_t > findHandlerForMessage(const protocol::InMessage &msg) const
Locates a registered handler (of any message type) for a given message.
std::vector< protocol::OutMessage > handling_function_response_t
#define IRSOL_LOG_ERROR(...)
Logs an error-level message using the default logger.
#define IRSOL_LOG_TRACE(...)
Logs a trace-level message using the default logger.
std::variant< Assignment, Inquiry, Command > InMessage
Variant type representing any incoming message.
std::string toString(const InMessage &msg)
Converts an incoming message variant to a human-readable string.
Logging utilities and configuration for the irsol library.
Message routing layer between protocol and application logic.
constexpr auto makeHandler(std::shared_ptr< Context > ctx, Args &&... args)
Constructs a handler instance of the given type.
std::string client_id_t
Represents a unique client identifier. Typically used to identify connected clients by string IDs.
static Error from(const T &msg, const std::string &description)
Creates an error from a specific incoming message type.