Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
Loading...
Searching...
No Matches
stalleventsource.h
Go to the documentation of this file.
1#pragma once
2
5
6#include <sonde/eventsource.h>
7
8#include <chrono>
9#include <functional>
10
11namespace Sonde {
12
14
33class SONDE_CORE_EXPORT StallEventSource : public EventSource
34{
35 Q_OBJECT
36public:
38 explicit StallEventSource(std::chrono::milliseconds threshold = std::chrono::milliseconds(250),
39 QObject *parent = nullptr);
41 ~StallEventSource() override;
42
44 std::chrono::milliseconds threshold() const;
45
51 void setBackgroundCheck(std::function<bool()> inBackground);
52
53private:
54 friend class StallEventSourcePrivate;
56};
57
58} // namespace Sonde
EventSource(QString name, QString description={ }, QObject *parent=nullptr)
Creates a source called name (used in filters and resource URIs), described by description in the eve...
Definition eventsource.cpp:18
Owns a class's private part, like std::unique_ptr, but a const owner only gets a const pointer,...
Definition privateptr.h:20
StallEventSource's private part.
Definition stalleventsource_p.h:20
PrivatePtr< StallEventSourcePrivate > d
Implementation.
Definition stalleventsource.h:55
StallEventSource(std::chrono::milliseconds threshold=std::chrono::milliseconds(250), QObject *parent=nullptr)
Starts watching the current thread; stalls longer than threshold are reported.
Definition stalleventsource.cpp:38
std::chrono::milliseconds threshold() const
The shortest stall reported.
Definition stalleventsource.cpp:86
void setBackgroundCheck(std::function< bool()> inBackground)
Sets a check for "the application is in the background".
Definition stalleventsource.cpp:91
Sonde::EventSource, the base class of event streams.
Embeddable Model Context Protocol server for Qt applications.
Definition dispatch.cpp:10