Source code of Windows XP (NT5)
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.

105 lines
3.1 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1997.
  5. //
  6. // File: PMComp.hxx
  7. //
  8. // Contents: Persistent index decompressor using during master merge
  9. //
  10. // Classes: CMPersDeComp
  11. //
  12. // History: 21-Apr-94 DwightKr Created
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include "pcomp.hxx"
  17. class CSplitKeyInfo;
  18. //+---------------------------------------------------------------------------
  19. //
  20. // Class: CMPersDeComp
  21. //
  22. // Purpose: Persistent index de-compressor uding during master merges
  23. //
  24. // History: 21-Apr-94 DwightKr Created.
  25. //
  26. // Notes: An implementation of the CPersDeComp class used during
  27. // master merge only.
  28. //----------------------------------------------------------------------------
  29. class CMPersDeComp: public CKeyCursor
  30. {
  31. public:
  32. CMPersDeComp(
  33. PDirectory & curDir,
  34. INDEXID curIid,
  35. CPhysIndex & curIndex,
  36. WORKID curWidMax,
  37. PDirectory & newDir,
  38. INDEXID newIid,
  39. CPhysIndex & newIndex,
  40. const CKey * pKey,
  41. WORKID newWidMax,
  42. const CSplitKeyInfo & splitKeyInfo,
  43. CMutexSem & mutex );
  44. virtual ~CMPersDeComp();
  45. const CKeyBuf * GetKey();
  46. const CKeyBuf * GetNextKey();
  47. const CKeyBuf * GetNextKey( BitOffset * pbitOff );
  48. WORKID WorkId();
  49. WORKID NextWorkId();
  50. ULONG WorkIdCount();
  51. OCCURRENCE Occurrence();
  52. OCCURRENCE NextOccurrence();
  53. ULONG OccurrenceCount();
  54. OCCURRENCE MaxOccurrence();
  55. ULONG HitCount();
  56. void RatioFinished ( ULONG& denom, ULONG& num )
  57. {
  58. _pActiveCursor->RatioFinished (denom, num);
  59. }
  60. void FreeStream() { _pActiveCursor->FreeStream(); }
  61. void RefillStream() { _pActiveCursor->RefillStream(); }
  62. protected:
  63. PDirectory & _curDir; // Directory of the current master index
  64. INDEXID _curIid; // Index id of the current master index
  65. CPhysIndex & _curIndex; // Physical index containing current master
  66. WORKID _curWidMax; // WidMax of current master index.
  67. PDirectory & _newDir; // Directory of the new master index
  68. INDEXID _newIid; // Index id of the new master index
  69. CPhysIndex & _newIndex; // Physical index containing new master
  70. WORKID _newWidMax; // Max WORKID in the new master index
  71. const CSplitKeyInfo & _splitKeyInfo; // up to date split key info
  72. BOOL _fUseNewIndex; // Currently using new or current master
  73. CPersDeComp * _pActiveCursor; // Current active cursor
  74. CKeyBuf _lastSplitKeyBuf; // most recent split key buf
  75. BitOffset _lastSplitKeyOffset; // most recent split key offset
  76. CMutexSem & _mutex; // serialize splitkeyinfo access
  77. };