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.

54 lines
1022 B

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