20template<
typename CommandHandler,
typename CommandParser>
struct event_handler
26 std::shared_ptr<async::async_queue<events::display_filter_input_t>>
display;
27 std::shared_ptr<async::async_queue<events::transport::in_t>>
transport;
28 std::shared_ptr<async::async_queue<events::session_orchestrator::in_t>>
session;
40 std::shared_ptr<CommandParser> parser,
42 : command_handler_(std::move(
command_handler)), parser_(std::move(parser))
54 auto command = parser_->parse(event.input);
55 std::visit(*command_handler_, command);
59 std::shared_ptr<CommandHandler> command_handler_;
60 std::shared_ptr<CommandParser> parser_;
Thread-safe asynchronous queue for message passing between coroutines.
decltype(make_command_handler(std::declval< std::shared_ptr< Bridge > >(), std::declval< std::shared_ptr< async::async_queue< events::display_filter_input_t > > >(), std::declval< std::shared_ptr< async::async_queue< events::transport::in_t > > >(), std::declval< std::shared_ptr< async::async_queue< events::session_orchestrator::in_t > > >(), std::declval< std::shared_ptr< async::async_queue< events::connection_monitor::in_t > > >())) command_handler
std::shared_ptr< async::async_queue< events::session_orchestrator::in_t > > session
std::shared_ptr< async::async_queue< events::connection_monitor::in_t > > connection_monitor
std::shared_ptr< async::async_queue< events::display_filter_input_t > > display
std::shared_ptr< async::async_queue< events::transport::in_t > > transport
Dispatches parsed command events to the command handler.
auto handle(const events::raw_command &event) const -> void
Parses and handles a raw command string.
event_handler(std::shared_ptr< CommandHandler > command_handler, std::shared_ptr< CommandParser > parser, const out_queues_t &)
Constructs an event handler with command handler and parser.
Raw unparsed command input.