Radix Relay
Hybrid mesh communications with Signal Protocol encryption
Loading...
Searching...
No Matches
radix_relay::core Namespace Reference

Namespaces

namespace  events
 

Classes

struct  command_handler_context
 
struct  command_parser
 Chain of Responsibility command parser. More...
 
class  connection_monitor
 
class  connection_monitor_processor
 Processes connection monitor events (transport status and queries). More...
 
struct  connection_status
 
struct  contact_info
 Information about a known contact. More...
 
struct  coroutine_state
 Tracks the lifecycle state of a spawned coroutine. More...
 
class  default_printer
 Default implementation of formatted console output. More...
 
struct  display_filter
 Filters display messages based on active chat context. More...
 
struct  event_handler
 Dispatches parsed command events to the command handler. More...
 
struct  overload
 Helper for std::visit with overload pattern. More...
 
struct  presentation_handler
 Handles presentation events and generates user-facing messages. More...
 
class  standard_processor
 Generic queue-processing loop that HasA handler (no virtual inheritance). More...
 
struct  transport_state
 
class  uuid_generator
 Utility for generating RFC 4122 UUIDs. More...
 

Concepts

concept  Processor
 Concept for types that can be run as processors.
 

Typedefs

template<concepts::signal_bridge Bridge>
using command_handler = 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 > > >()))
 
template<concepts::signal_bridge Bridge>
using standard_event_handler_t = event_handler< command_handler< Bridge >, Bridge >
 Type alias for the standard event handler using command_handler.
 

Functions

template<concepts::signal_bridge Bridge>
auto make_command_handler (std::shared_ptr< Bridge > bridge, std::shared_ptr< async::async_queue< events::display_filter_input_t > > display_queue, std::shared_ptr< async::async_queue< events::transport::in_t > > transport_queue, std::shared_ptr< async::async_queue< events::session_orchestrator::in_t > > session_queue, std::shared_ptr< async::async_queue< events::connection_monitor::in_t > > connection_monitor_queue)
 
template<class... Ts>
 overload (Ts...) -> overload< Ts... >
 
template<Processor P>
auto run_processor (std::shared_ptr< P > proc, std::shared_ptr< boost::asio::cancellation_slot > cancel_slot, std::string_view processor_name) -> boost::asio::awaitable< void >
 Runs a processor coroutine with error handling.
 
template<Processor P>
auto spawn_processor (const std::shared_ptr< boost::asio::io_context > &io_ctx, std::shared_ptr< P > proc, std::shared_ptr< boost::asio::cancellation_slot > cancel_slot, std::string_view processor_name) -> std::shared_ptr< coroutine_state >
 Spawns a processor as a detached coroutine.
 
auto is_version_compatible (const std::string &version_str, const std::string &minimum_version_str) -> bool
 Checks if a version meets a minimum version requirement.
 

Typedef Documentation

◆ command_handler

template<concepts::signal_bridge Bridge>
using radix_relay::core::command_handler = typedef 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> >>()))

Definition at line 251 of file command_handler.hpp.

◆ standard_event_handler_t

template<concepts::signal_bridge Bridge>
using radix_relay::core::standard_event_handler_t = typedef event_handler<command_handler<Bridge>, Bridge>

Type alias for the standard event handler using command_handler.

Template Parameters
BridgeType satisfying the signal_bridge concept

Combines event_handler with command_handler to create a complete command processing pipeline.

Definition at line 17 of file standard_event_handler.hpp.

Function Documentation

◆ is_version_compatible()

auto radix_relay::core::is_version_compatible ( const std::string &  version_str,
const std::string &  minimum_version_str 
) -> bool
inline

Checks if a version meets a minimum version requirement.

Parameters
version_strVersion string in semantic versioning format (e.g., "1.2.3")
minimum_version_strMinimum required version string
Returns
true if version >= minimum_version, false otherwise or on parse error

Definition at line 15 of file semver_utils.hpp.

Referenced by radix_relay::nostr::message_handler< Bridge >::handle().

◆ make_command_handler()

◆ overload()

template<class... Ts>
radix_relay::core::overload ( Ts...  ) -> overload< Ts... >

◆ run_processor()

template<Processor P>
auto radix_relay::core::run_processor ( std::shared_ptr< P >  proc,
std::shared_ptr< boost::asio::cancellation_slot >  cancel_slot,
std::string_view  processor_name 
) -> boost::asio::awaitable<void>

Runs a processor coroutine with error handling.

Template Parameters
PProcessor type
Parameters
procThe processor to run
cancel_slotCancellation slot for stopping the processor
processor_nameName for logging
Returns
Awaitable that completes when the processor exits

Definition at line 37 of file processor_runner.hpp.

Referenced by spawn_processor().

◆ spawn_processor()

template<Processor P>
auto radix_relay::core::spawn_processor ( const std::shared_ptr< boost::asio::io_context > &  io_ctx,
std::shared_ptr< P >  proc,
std::shared_ptr< boost::asio::cancellation_slot >  cancel_slot,
std::string_view  processor_name 
) -> std::shared_ptr<coroutine_state>

Spawns a processor as a detached coroutine.

Template Parameters
PProcessor type
Parameters
io_ctxBoost.Asio io_context to spawn on
procThe processor to spawn
cancel_slotCancellation slot for stopping the processor
processor_nameName for logging
Returns
Shared pointer to coroutine state for tracking lifecycle

Definition at line 78 of file processor_runner.hpp.

References run_processor().