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.

88 lines
2.2 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1992.
  5. //
  6. // File: PROXCUR.HXX
  7. //
  8. // Contents: Proximity cursor
  9. //
  10. // Classes: CProxCursor
  11. //
  12. // History: 14-Apr-92 AmyA Created.
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #ifdef DISPLAY_INCLUDES
  17. #pragma message( "#include <" __FILE__ ">..." )
  18. #endif
  19. #include <cursor.hxx>
  20. #include <curheap.hxx>
  21. class COccCurStack;
  22. #define PROX_MAX 50
  23. extern unsigned ProxDefault[];
  24. //+---------------------------------------------------------------------------
  25. //
  26. // Class: CProxCursor
  27. //
  28. // Purpose: Boolean And cursor (find documents that contain all of
  29. // the specified keys). Works with a single index. Differs from
  30. // CAndCursor because occurrence information is kept so that
  31. // proximity of items can be determined.
  32. //
  33. // History: 14-Apr-92 AmyA Created.
  34. // 28-Jun-94 SitaramR Added _logWidMax.
  35. //
  36. //----------------------------------------------------------------------------
  37. class CProxCursor: public CCursor
  38. {
  39. public:
  40. CProxCursor ( unsigned cCursor,
  41. COccCurStack& curStack,
  42. LONG maxDist = MAX_QUERY_RANK );
  43. ~CProxCursor() {} // default destructors take care of all the data
  44. // structures...
  45. WORKID WorkId();
  46. WORKID NextWorkId();
  47. ULONG HitCount();
  48. LONG Rank();
  49. LONG Hit();
  50. LONG NextHit();
  51. void RatioFinished ( ULONG& denom, ULONG& num );
  52. private:
  53. void FindConjunction();
  54. LONG CalculateRank();
  55. WORKID _wid;
  56. COccHeapOfOccCur _occHeap;
  57. unsigned _cCur;
  58. LONG _maxDist;
  59. LONG _rank; // keeps track of rank so that it will be
  60. // accurate even if HitCount is called first.
  61. ULONG _logWidMax;
  62. };