| 1 | #ifndef AVERAGELOADMANAGER_H |
| 2 | #define AVERAGELOADMANAGER_H |
| 3 | |
| 4 | #include <QObject> |
| 5 | |
| 6 | class QTimer; |
| 7 | |
| 8 | /*! |
| 9 | * \class AverageLoadManager |
| 10 | * |
| 11 | * \inmodule ThreadWeaver |
| 12 | */ |
| 13 | class AverageLoadManager : public QObject |
| 14 | { |
| 15 | Q_OBJECT |
| 16 | public: |
| 17 | /*! |
| 18 | */ |
| 19 | explicit AverageLoadManager(QObject *parent = nullptr); |
| 20 | |
| 21 | /*! |
| 22 | */ |
| 23 | void activate(bool enabled); |
| 24 | /*! |
| 25 | */ |
| 26 | bool available() const; |
| 27 | /*! |
| 28 | */ |
| 29 | QPair<int, int> workersRange() const; |
| 30 | |
| 31 | Q_SIGNALS: |
| 32 | /*! |
| 33 | */ |
| 34 | void recommendedWorkerCount(int); |
| 35 | |
| 36 | private Q_SLOTS: |
| 37 | /*! |
| 38 | */ |
| 39 | void update(); |
| 40 | |
| 41 | private: |
| 42 | QTimer *m_timer; |
| 43 | int m_min, m_max; |
| 44 | }; |
| 45 | |
| 46 | #endif // AVERAGELOADMANAGER_H |
| 47 | |