36 std::enable_if_t<irsol::traits::is_type_in_variant<T, irsol::protocol::InMessage>::value,
int> =
76 virtual std::vector<out_message_t>
process(
77 std::shared_ptr<irsol::server::ClientSession>
session,
81 std::shared_ptr<Context>
ctx;
Generic handler base class for protocol messages.
virtual std::vector< out_message_t > operator()(const irsol::types::client_id_t &clientId, T &&message)
Invokes the handler for a given client and message.
virtual std::vector< out_message_t > process(std::shared_ptr< irsol::server::ClientSession > session, T &&message)=0
Processes the protocol message for the given session.
std::shared_ptr< Context > ctx
Handler context (provides access to app and utilities).
HandlerBase(std::shared_ptr< Context > ctx)
Constructs the handler base.
Declaration of the handler context struct.
#define IRSOL_LOG_ERROR(...)
Logs an error-level message using the default logger.
std::variant< Assignment, Inquiry, Command > InMessage
Variant type representing any incoming message.
std::variant< Success, BinaryDataBuffer, ImageBinaryData, ColorImageBinaryData, Error > OutMessage
Variant type representing any outgoing message.
protocol::OutMessage out_message_t
constexpr auto makeHandler(std::shared_ptr< Context > ctx, Args &&... args)
Constructs a handler instance of the given type.
protocol::InMessage in_message_t
std::string client_id_t
Represents a unique client identifier. Typically used to identify connected clients by string IDs.
Template metaprogramming traits for type introspection in the irsol library.