|
Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
|
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. | |
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.
| 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).