Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
Loading...
Searching...
No Matches
Sonde::anonymous_namespace{logeventsource.cpp}::HandlerState Struct Reference

Process-wide state of the message handler. More...

Public Attributes

QMutex mutex
 Guards instance, and changes to installed.
LogEventSource * instance = nullptr
 The active source, if any.
std::atomic< QtMessageHandler > previous { nullptr }
 Handler to chain to.
std::atomic< bool > installed { false }
 Whether messageHandler() is part of Qt's handler chain.
std::atomic< bool > listening { false }
 Whether a source is active (instance is set); atomic for the same reason.

Detailed Description

Process-wide state of the message handler.

Qt allows exactly one handler, so this is necessarily global; it is reached through a function to keep initialization order well defined.

Member Data Documentation

◆ installed

std::atomic<bool> Sonde::anonymous_namespace{logeventsource.cpp}::HandlerState::installed { false }

Whether messageHandler() is part of Qt's handler chain.

It can stay there, passing messages through, after its source is gone (see ~LogEventSource). Atomic so the category filter can read it without the mutex: the filter can run while this thread holds it (a category created in a slot post() calls).


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