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.

103 lines
2.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1994.
  5. //
  6. // File: buketize.hxx
  7. //
  8. // Contents: A class to convert windows into a bucket.
  9. //
  10. // Classes: CBucketizeWindows
  11. //
  12. // History: 2-16-95 srikants Created
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include <query.hxx>
  17. #include <tablecol.hxx>
  18. #include <seglist.hxx>
  19. #include "colcompr.hxx"
  20. #include "tblwindo.hxx"
  21. #include "tblbuket.hxx"
  22. //+---------------------------------------------------------------------------
  23. //
  24. // Class: CBucketizeWindows
  25. //
  26. // Purpose: A class to convert a window into a bucket.
  27. //
  28. // History: 2-17-95 srikants Created
  29. //
  30. // Notes:
  31. //
  32. //----------------------------------------------------------------------------
  33. class CMasterColumnSet;
  34. class CWindowRowIter;
  35. class CLargeTable;
  36. class CBucketizeWindows : INHERIT_UNWIND
  37. {
  38. INLINE_UNWIND(CBucketizeWindows)
  39. public:
  40. CBucketizeWindows( CLargeTable & largeTable, CTableWindow &srcWindow );
  41. ~CBucketizeWindows()
  42. {
  43. delete _pBucket;
  44. }
  45. void LokCreateBuckets( const CSortSet & sortSet,
  46. CTableKeyCompare & comparator,
  47. CColumnMasterSet & colSet
  48. );
  49. CTableBucket * AcquireFirst()
  50. {
  51. CTableSegment * pTemp = _bktList.RemoveTop();
  52. if ( 0 != pTemp )
  53. {
  54. Win4Assert( pTemp->IsBucket() );
  55. return (CTableBucket *) pTemp;
  56. }
  57. else
  58. {
  59. return 0;
  60. }
  61. }
  62. CTableSegList & GetBucketsList() { return _bktList; }
  63. private:
  64. //
  65. // Array of source windows and the count.
  66. //
  67. CLargeTable & _largeTable;
  68. CTableWindow & _srcWindow;
  69. //
  70. // Information on the current bucket.
  71. //
  72. BOOL _fFirstBkt; // Set to TRUE if this is the first
  73. // bkt.
  74. ULONG _cRowsToCopy; // Number of rows to copy from window
  75. // to the bucket.
  76. CTableBucket * _pBucket; // Current bucket being filled
  77. //
  78. // The target buckets.
  79. //
  80. CTableSegList _bktList;
  81. ULONG _AddWorkIds( CWindowRowIter & iter );
  82. };