sysinfo.h 499 B

123456789101112131415161718192021222324252627
  1. #ifndef SYSINFO_H
  2. #define SYSINFO_H
  3. /**
  4. * @brief The SysInfo 接口
  5. */
  6. class SysInfo {
  7. public:
  8. static SysInfo& instance();
  9. virtual ~SysInfo();
  10. // Allows the derived class to perform any initialization process depending on
  11. // the OS platform
  12. virtual void init() = 0;
  13. virtual double cpuLoadAverage() = 0;
  14. virtual double memoryUsed() = 0;
  15. protected:
  16. explicit SysInfo();
  17. private:
  18. SysInfo(const SysInfo& rhs);
  19. SysInfo& operator=(const SysInfo& rhs);
  20. };
  21. #endif // SYSINFO_H