sysinfowindowsimpl.h 594 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef SYSINFOWINDOWSIMPL_H
  2. #define SYSINFOWINDOWSIMPL_H
  3. #ifdef __WINDOWS__
  4. #include <windows.h>
  5. #endif
  6. #include <QVector>
  7. #include <QtGlobal>
  8. #include "sysinfo.h"
  9. typedef struct _FILETIME FILETIME;
  10. class SysInfoWindowsImpl : public SysInfo {
  11. public:
  12. SysInfoWindowsImpl();
  13. // SysInfo interface
  14. void init() override;
  15. double cpuLoadAverage() override;
  16. double memoryUsed() override;
  17. private:
  18. QVector<qulonglong> cpuRawData();
  19. qulonglong convertFileTime(const FILETIME& filetime) const;
  20. private:
  21. QVector<qulonglong> mCpuLoadLastValues;
  22. };
  23. #endif // SYSINFOWINDOWSIMPL_H