Radix Relay
Hybrid mesh communications with Signal Protocol encryption
Loading...
Searching...
No Matches
radix_relay::core::event_handler< CmdHandler > Struct Template Reference

Parses raw command strings into typed command events. More...

#include <event_handler.hpp>

Classes

struct  out_queues_t
 

Public Types

using command_handler_t = CmdHandler
 
using in_queue_t = async::async_queue< events::raw_command >
 

Public Member Functions

 event_handler (std::shared_ptr< CmdHandler > command_handler, const out_queues_t &)
 Constructs an event handler with the given command handler.
 
auto handle (const events::raw_command &event) const -> void
 Parses and handles a raw command string.
 

Detailed Description

template<concepts::command_handler CmdHandler>
struct radix_relay::core::event_handler< CmdHandler >

Parses raw command strings into typed command events.

Template Parameters
CmdHandlerType satisfying the command_handler concept

Converts raw text commands from the user into strongly-typed event structures and dispatches them to the command handler.

Definition at line 20 of file event_handler.hpp.

Member Typedef Documentation

◆ command_handler_t

template<concepts::command_handler CmdHandler>
using radix_relay::core::event_handler< CmdHandler >::command_handler_t = CmdHandler

Definition at line 22 of file event_handler.hpp.

◆ in_queue_t

template<concepts::command_handler CmdHandler>
using radix_relay::core::event_handler< CmdHandler >::in_queue_t = async::async_queue<events::raw_command>

Definition at line 25 of file event_handler.hpp.

Constructor & Destructor Documentation

◆ event_handler()

template<concepts::command_handler CmdHandler>
radix_relay::core::event_handler< CmdHandler >::event_handler ( std::shared_ptr< CmdHandler >  command_handler,
const out_queues_t  
)
inlineexplicit

Constructs an event handler with the given command handler.

Parameters
command_handlerShared pointer to the command handler
queuesOutput queues (unused for event_handler)

Definition at line 38 of file event_handler.hpp.

Member Function Documentation

◆ handle()

template<concepts::command_handler CmdHandler>
auto radix_relay::core::event_handler< CmdHandler >::handle ( const events::raw_command event) const -> void
inline

The documentation for this struct was generated from the following file: