Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
845 B

  1. /*++
  2. Copyright (C) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. COUNTER.H
  5. History:
  6. --*/
  7. #ifndef ESPUTIL_COUNTER_H
  8. #define ESPUTIL_COUNTER_H
  9. class LTAPIENTRY CCounter
  10. {
  11. public:
  12. CCounter(const TCHAR *);
  13. UINT operator++(void);
  14. UINT operator--(void);
  15. void operator+=(UINT);
  16. void operator-=(UINT);
  17. void Dump(void) const;
  18. ~CCounter();
  19. private:
  20. UINT m_uiCurCount;
  21. UINT m_uiMaxCount;
  22. UINT m_uiTotal;
  23. const TCHAR *m_szDescription;
  24. };
  25. //------------------------------------------------------------------------------
  26. class LTAPIENTRY CSmartCheck
  27. {
  28. public:
  29. CSmartCheck(DWORD dwFreqMilli = 2000);
  30. void Reset();
  31. BOOL Check();
  32. protected:
  33. DWORD m_dwFreqMilli;
  34. DWORD m_dwCancelTickMin; // prevents calling fCancel() too often
  35. DWORD m_dwCancelTickMax;
  36. };
  37. #endif