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.

78 lines
1.8 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1992.
  5. //
  6. // File: WLCURSOR.HXX
  7. //
  8. // Contents: Wordlist Merge Cursor
  9. //
  10. // Classes: CWlCursor
  11. //
  12. // History: 17-Jun-91 BarotszM Created.
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include <keycur.hxx>
  17. #include "kcurheap.hxx"
  18. class CKeyCurStack;
  19. //+---------------------------------------------------------------------------
  20. //
  21. // Class: CWlCursor
  22. //
  23. // Purpose: Merge cursor, merges several sorts into one ordered cursor
  24. //
  25. // History: 17-Jun-91 BartoszM Created.
  26. //
  27. // Notes: Merges occurrences too (unlike straight merge cursor)
  28. //
  29. //----------------------------------------------------------------------------
  30. class CWlCursor: public CKeyCursor
  31. {
  32. public:
  33. CWlCursor( int cCursor, CKeyCurStack & stkCursor, WORKID widMax );
  34. const CKeyBuf * GetKey();
  35. const CKeyBuf * GetNextKey();
  36. WORKID WorkId();
  37. WORKID NextWorkId();
  38. OCCURRENCE Occurrence();
  39. OCCURRENCE NextOccurrence();
  40. ULONG OccurrenceCount();
  41. OCCURRENCE MaxOccurrence();
  42. ULONG WorkIdCount();
  43. ULONG HitCount();
  44. void RatioFinished ( ULONG& denom, ULONG& num );
  45. private:
  46. BOOL ReplenishOcc();
  47. BOOL ReplenishWid();
  48. void ComputeWidCount();
  49. void ComputeOccCount();
  50. CKeyHeap _keyHeap;
  51. CIdxWidHeap _widHeap;
  52. COccHeapOfKeyCur _occHeap;
  53. ULONG _ulWidCount;
  54. ULONG _ulOccCount;
  55. };