4#include <RumPi/AlertManager.h>
wxDECLARE_EVENT(wxEVT_RUMPI_LOGGER_UPDATE, wxThreadEvent)
Custom event used to carry a finished log line from the AlertManager (worker thread) to the UI (main ...
Bridges the library's AlertManager to the wxWidgets event system: it subscribes to the AlertManager o...
Definition: LoggerEventForwarder.h:18
std::size_t mySubscriptionId
Handle for the AlertManager subscription, so the destructor can unsubscribe.
Definition: LoggerEventForwarder.h:23
LoggerEventForwarder & operator=(const LoggerEventForwarder &)=delete
wxEvtHandler * myWxEventHandler
The UI event handler that receives forwarded log events.
Definition: LoggerEventForwarder.h:20
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_...
Definition: LoggerEventForwarder.cpp:63
LoggerEventForwarder(wxEvtHandler *handler)
Subscribes to the AlertManager and stores the given UI handler so every alert is forwarded to it.
Definition: LoggerEventForwarder.cpp:21
~LoggerEventForwarder()
Unsubscribes from the AlertManager so a later alert can't call into a destroyed forwarder.
Definition: LoggerEventForwarder.cpp:44
LoggerEventForwarder(const LoggerEventForwarder &)=delete