60 std::enable_if_t<irsol::traits::is_type_in_variant<T, irsol::protocol::InMessage>::value,
int> =
66 out_message_t>(std::shared_ptr<Context>, std::shared_ptr<irsol::server::ClientSession>,
T&&)>;
85 std::shared_ptr<irsol::server::ClientSession>
session,
Base handler templates for protocol message processing.
Handler class that delegates protocol message processing to a lambda or callable.
LambdaHandler(std::shared_ptr< irsol::server::handlers::Context > ctx, lambda_function_t callback)
Constructs a LambdaHandler with the given context and callback.
std::function< std::vector< out_message_t >(std::shared_ptr< Context >, std::shared_ptr< irsol::server::ClientSession >, T &&)> lambda_function_t
std::vector< out_message_t > process(std::shared_ptr< irsol::server::ClientSession > session, T &&message) final override
Processes the protocol message by invoking the stored lambda/callable.
lambda_function_t m_callback
The lambda or callable to invoke for each message.
Generic handler base class for protocol messages.
std::shared_ptr< Context > ctx
Handler context (provides access to app and utilities).
HandlerBase(std::shared_ptr< Context > ctx)
Constructs the handler base.
protocol::OutMessage out_message_t
constexpr auto makeHandler(std::shared_ptr< Context > ctx, Args &&... args)
Constructs a handler instance of the given type.
Template metaprogramming traits for type introspection in the irsol library.