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.

82 lines
1.7 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1992.
  5. //
  6. // File: MCURSOR.HXX
  7. //
  8. // Contents: Merge Cursor
  9. //
  10. // Classes: CMergeCursor
  11. //
  12. // History: 06-May-91 BarotszM Created.
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include <keycur.hxx>
  17. #include "kcurheap.hxx"
  18. class CKeyCurStack;
  19. //+---------------------------------------------------------------------------
  20. //
  21. // Class: CMergeCursor
  22. //
  23. // Purpose: Merge cursor, merges several cursors into one ordered cursor
  24. // The cursors come from different indexes. The call to
  25. // NextWorkId may return the same wid, changing only index id.
  26. //
  27. // History: 06-May-91 BartoszM Created.
  28. // 27-Feb-92 AmyA Added HitCount
  29. //
  30. //----------------------------------------------------------------------------
  31. class CMergeCursor: public CKeyCursor
  32. {
  33. public:
  34. CMergeCursor( CKeyCurStack & stkCursor );
  35. ~CMergeCursor() {} // heaps are deleted
  36. const CKeyBuf * GetKey();
  37. const CKeyBuf * GetNextKey();
  38. WORKID WorkId();
  39. WORKID NextWorkId();
  40. OCCURRENCE Occurrence();
  41. OCCURRENCE NextOccurrence();
  42. ULONG OccurrenceCount();
  43. OCCURRENCE MaxOccurrence();
  44. ULONG WorkIdCount();
  45. ULONG HitCount();
  46. void RatioFinished ( ULONG& denom, ULONG& num )
  47. {
  48. Win4Assert ( !"RatioFinished called on CMergeCursor\n" );
  49. }
  50. void FreeStream();
  51. void RefillStream();
  52. protected:
  53. BOOL ReplenishWid();
  54. CKeyHeap _keyHeap;
  55. CIdxWidHeap _widHeap;
  56. };