1
0

stats.h 714 B

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include "api_stats.h"
  3. #include <api/service/services.h>
  4. class Stats : public api_stats
  5. {
  6. public:
  7. static const char *getServiceName() { return "Anonymous Statistics API"; }
  8. static const GUID getServiceGuid() { return AnonymousStatsGUID; }
  9. static FOURCC getServiceType() { return WaSvc::UNIQUE; }
  10. public:
  11. Stats();
  12. void Init();
  13. void Write();
  14. /* API implementation */
  15. void SetStat(int stat, int value);
  16. void IncrementStat(int stat);
  17. void GetStats(int stats[NUM_STATS]) const;
  18. void SetString(const char *key, const wchar_t *value);
  19. void GetString(const char *key, wchar_t *value, size_t value_cch) const;
  20. private:
  21. int values[NUM_STATS];
  22. protected:
  23. RECVS_DISPATCH;
  24. };
  25. extern Stats stats;