|
Radix Relay
Hybrid mesh communications with Signal Protocol encryption
|
Dispatches parsed command events to the command handler. More...
#include <event_handler.hpp>
Classes | |
| struct | out_queues_t |
Public Types | |
| using | in_queue_t = async::async_queue< events::raw_command > |
Public Member Functions | |
| 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. | |
| auto | handle (const events::raw_command &event) const -> void |
| Parses and handles a raw command string. | |
Dispatches parsed command events to the command handler.
| CommandHandler | Callable type that handles typed command events via operator() |
| CommandParser | Parser type with command_variant_t type trait and parse() method |
Uses Chain of Responsibility (parser) + Visitor (command_handler) pattern:
Definition at line 20 of file event_handler.hpp.
| using radix_relay::core::event_handler< CommandHandler, CommandParser >::in_queue_t = async::async_queue<events::raw_command> |
Definition at line 22 of file event_handler.hpp.
|
inlineexplicit |
Constructs an event handler with command handler and parser.
| command_handler | Command handler that handles typed commands (shared ownership) |
| parser | Command parser for converting strings to typed events |
| queues | Output queues (stored for type compatibility, handler uses its own references) |
Definition at line 39 of file event_handler.hpp.
|
inline |
Parses and handles a raw command string.
Parses input to typed command and dispatches via std::visit.
| event | Raw command event containing unparsed user input |
Definition at line 52 of file event_handler.hpp.