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.

92 lines
3.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: qiterate.hxx
  7. //
  8. // Contents: Iterator for OR query restriction
  9. //
  10. // History: 30-May-95 SitaramR Created
  11. //
  12. //--------------------------------------------------------------------------
  13. #pragma once
  14. #include <xpr.hxx>
  15. #include <timlimit.hxx>
  16. #include <ciintf.h>
  17. //+---------------------------------------------------------------------------
  18. //
  19. // Class: CQueryRstIterator
  20. //
  21. // Purpose: Iterate over the various children of OR restriction
  22. //
  23. // History: 30-May-95 SitaramR Created
  24. //
  25. //----------------------------------------------------------------------------
  26. class CQueryRstIterator : INHERIT_UNWIND
  27. {
  28. INLINE_UNWIND( CQueryRstIterator );
  29. public:
  30. CQueryRstIterator( ICiCDocStore *pDocStore,
  31. XRestriction& xRst,
  32. CTimeLimit& timeLimit,
  33. BOOL& fCIRequiredGlobal,
  34. BOOL fNoTimeout,
  35. BOOL fValidateCatalog = TRUE );
  36. ~CQueryRstIterator() { }
  37. void GetFirstComponent( XRestriction& xFullyIndexableRst, XXpr& xXpr );
  38. void GetNextComponent( XRestriction& xFullyIndexableRst, XXpr& xXpr );
  39. BOOL AtEnd();
  40. BOOL IsSingleComponent() { return _fSingleComponent; }
  41. BOOL FResolvingFirstComponent() { return _fResolvingFirstComponent; }
  42. inline void GetCurComponentIndex( unsigned& _iQueryComp, unsigned& _cQueryComp ) const;
  43. private:
  44. void SeparateRst( XRestriction& xRst,
  45. XRestriction& xFullyIndexableRst,
  46. XXpr& xXpr );
  47. inline BOOL Validate( CRestriction *pFullyIndexableRst ) const;
  48. BOOL _fSingleComponent; // does the query have just one component ?
  49. XInterface<ICiManager> _xCiManager; // Content index
  50. XRestriction _xRst;
  51. CTimeLimit& _timeLimit;
  52. BOOL _fResolvingFirstComponent; // are we resolving the first component ?
  53. unsigned _iQueryComp; // index of current OR query component
  54. unsigned _cQueryComp; // count of OR query components
  55. BOOL _fValidateCat; // Whether to validate catalog
  56. };
  57. //+---------------------------------------------------------------------------
  58. //
  59. // Member: CQueryRstIterator::GetCurComponentIndex
  60. //
  61. // Synopsis: Get index of current component of OR query and the total # components
  62. //
  63. // Arguments: [iQueryComp] -- updated with index of current component
  64. // [cQueryComp] -- updated with count of components
  65. //
  66. // History: 30-Jun-95 SitaramR Created
  67. //
  68. //----------------------------------------------------------------------------
  69. inline void CQueryRstIterator::GetCurComponentIndex( unsigned& iQueryComp,
  70. unsigned& cQueryComp ) const
  71. {
  72. iQueryComp = _iQueryComp;
  73. cQueryComp = _cQueryComp;
  74. }