1 | #ifndef AVERAGELOADMANAGER_H |
2 | #define AVERAGELOADMANAGER_H |
3 | |
4 | #include <QObject> |
5 | |
6 | class QTimer; |
7 | |
8 | class AverageLoadManager : public QObject |
9 | { |
10 | Q_OBJECT |
11 | public: |
12 | explicit AverageLoadManager(QObject *parent = nullptr); |
13 | |
14 | void activate(bool enabled); |
15 | bool available() const; |
16 | QPair<int, int> workersRange() const; |
17 | |
18 | Q_SIGNALS: |
19 | void recommendedWorkerCount(int); |
20 | |
21 | private Q_SLOTS: |
22 | void update(); |
23 | |
24 | private: |
25 | QTimer *m_timer; |
26 | int m_min, m_max; |
27 | }; |
28 | |
29 | #endif // AVERAGELOADMANAGER_H |
30 | |