RumPi Linux Client 1.0
A wxWidgets desktop dashboard that visualizes a RumPi robot's live sensor data as a condition-reactive scene
LoggerEventForwarder Class Reference

Bridges the library's AlertManager to the wxWidgets event system: it subscribes to the AlertManager once and forwards every alert to the given wxEvtHandler as a wxEVT_RUMPI_LOGGER_UPDATE carrying a ready-to-display LoggerLineData. More...

#include <LoggerEventForwarder.h>

Public Member Functions

 LoggerEventForwarder (wxEvtHandler *handler)
 Subscribes to the AlertManager and stores the given UI handler so every alert is forwarded to it. More...
 
 LoggerEventForwarder (const LoggerEventForwarder &)=delete
 
LoggerEventForwarderoperator= (const LoggerEventForwarder &)=delete
 
 ~LoggerEventForwarder ()
 Unsubscribes from the AlertManager so a later alert can't call into a destroyed forwarder. More...
 
void HandleLoggerEvent (const RumPi::AlertEvent &loggerEvent)
 Builds a log line (pure data) from the alert and queues it to the UI handler as a wxEVT_RUMPI_LOGGER_UPDATE, so the actual UI update happens on the main thread. More...
 

Protected Attributes

wxEvtHandler * myWxEventHandler
 The UI event handler that receives forwarded log events. More...
 
std::size_t mySubscriptionId
 Handle for the AlertManager subscription, so the destructor can unsubscribe. More...
 

Detailed Description

Bridges the library's AlertManager to the wxWidgets event system: it subscribes to the AlertManager once and forwards every alert to the given wxEvtHandler as a wxEVT_RUMPI_LOGGER_UPDATE carrying a ready-to-display LoggerLineData.

This keeps the AlertManager subscription and the worker->UI thread hop out of the view code.

Author
Eddie O'Hagan
Date
8/13/2026

Constructor & Destructor Documentation

◆ LoggerEventForwarder() [1/2]

LoggerEventForwarder::LoggerEventForwarder ( wxEvtHandler *  handler)

Subscribes to the AlertManager and stores the given UI handler so every alert is forwarded to it.

Keeps the subscription handle so the destructor can unsubscribe.

Author
Eddie O'Hagan
Date
8/13/2026
LoggerEventForwarder forwarder(this);
Bridges the library's AlertManager to the wxWidgets event system: it subscribes to the AlertManager o...
Definition: LoggerEventForwarder.h:18
Parameters
[in]handlerThe UI event handler to forward alerts to.

◆ LoggerEventForwarder() [2/2]

LoggerEventForwarder::LoggerEventForwarder ( const LoggerEventForwarder )
delete

◆ ~LoggerEventForwarder()

LoggerEventForwarder::~LoggerEventForwarder ( )

Unsubscribes from the AlertManager so a later alert can't call into a destroyed forwarder.

Author
Eddie O'Hagan
Date
8/13/2026
//Runs when the forwarder is destroyed.

Member Function Documentation

◆ HandleLoggerEvent()

void LoggerEventForwarder::HandleLoggerEvent ( const RumPi::AlertEvent &  loggerEvent)

Builds a log line (pure data) from the alert and queues it to the UI handler as a wxEVT_RUMPI_LOGGER_UPDATE, so the actual UI update happens on the main thread.

Author
Eddie O'Hagan
Date
8/13/2026
//Invoked by the AlertManager on whichever thread reported the alert.
Parameters
[in]loggerEventThe alert event to forward.

◆ operator=()

LoggerEventForwarder & LoggerEventForwarder::operator= ( const LoggerEventForwarder )
delete

Member Data Documentation

◆ mySubscriptionId

std::size_t LoggerEventForwarder::mySubscriptionId
protected

Handle for the AlertManager subscription, so the destructor can unsubscribe.

◆ myWxEventHandler

wxEvtHandler* LoggerEventForwarder::myWxEventHandler
protected

The UI event handler that receives forwarded log events.


The documentation for this class was generated from the following files: