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.

68 lines
1.7 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 1991, Microsoft Corporation.
  4. //
  5. // File: XlatStat.hxx
  6. //
  7. // Contents: State translation class.
  8. //
  9. // Classes: CXlatState
  10. //
  11. // History: 01-20-92 KyleP Created
  12. // 03-11-97 arunk Modified for regex lib
  13. //--------------------------------------------------------------------------
  14. #ifndef __XLATSTAT_HXX__
  15. #define __XLATSTAT_HXX__
  16. #include <windows.h>
  17. class CStateSet;
  18. //+-------------------------------------------------------------------------
  19. //
  20. // Class: CXlatState
  21. //
  22. // Purpose: Maps state set to single state.
  23. //
  24. // History: 20-Jan-92 KyleP Created
  25. //
  26. //--------------------------------------------------------------------------
  27. class CXlatState
  28. {
  29. public:
  30. CXlatState( UINT MaxState = 32 );
  31. ~CXlatState();
  32. UINT XlatToOne( CStateSet const & ss );
  33. void XlatToMany( UINT iState, CStateSet & ss );
  34. private:
  35. void _Realloc();
  36. UINT _Search( CStateSet const & ss );
  37. UINT _Create( CStateSet const & ss );
  38. void _BuildState( ULONG * pState, CStateSet const & ss );
  39. //
  40. // Initial naive implementation: Just keep an array, where each
  41. // element is wide enough to contain 1 bit per possible state.
  42. //
  43. // The first state set in _pulStates is used as temporary space
  44. // during search.
  45. //
  46. UINT _StateSize; // # DWords / state
  47. ULONG * _pulStates; // Pointer to states
  48. UINT _cStates; // Size (in states) of pulStates
  49. UINT _cUsed; // Number of states in use.
  50. };
  51. #endif // __XLATSTAT_HXX__