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.

85 lines
2.2 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1999.
  5. //
  6. // File: VECCURS.HXX
  7. //
  8. // Contents: Vector cursor
  9. //
  10. // Classes: CVectorCursor
  11. //
  12. // History: 23-Jul-92 KyleP Created.
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #ifdef DISPLAY_INCLUDES
  17. #pragma message( "#include <" __FILE__ ">..." )
  18. #endif
  19. #include <curstk.hxx>
  20. #include <heap.hxx>
  21. #include <curheap.hxx>
  22. //+---------------------------------------------------------------------------
  23. //
  24. // Class: CVectorCursor
  25. //
  26. // Purpose: Vector cursor. Capable of returning a vector of ranks
  27. // from it's children.
  28. //
  29. // History: 23-Jul-92 KyleP Created.
  30. //
  31. //----------------------------------------------------------------------------
  32. class CVectorCursor: public CCursor
  33. {
  34. public:
  35. CVectorCursor( int cCursor,
  36. CCurStack& curStack,
  37. ULONG RankMethod );
  38. ~CVectorCursor() {}
  39. WORKID WorkId();
  40. WORKID NextWorkId();
  41. ULONG WorkIdCount();
  42. ULONG HitCount();
  43. LONG Rank();
  44. ULONG GetRankVector( LONG * plVector, ULONG cElements );
  45. LONG Hit();
  46. LONG NextHit();
  47. void RatioFinished ( ULONG& denom, ULONG& num );
  48. protected:
  49. void _RefreshRanks();
  50. CWidHeap _widHeap;
  51. XArray<CCursor *> _aChildCursor; // *Ordered* array of children.
  52. XArray<LONG> _aChildWeight; // Weight for each child.
  53. XArray<LONG> _aChildRank; // Rank vector for current wid.
  54. UINT _cChild; // # of children.
  55. LONG _lMaxWeight;
  56. LONG _lSumWeight;
  57. ULONG _ulSumSquaredWeight;
  58. WORKID _widRank; // Last wid for which rank was
  59. // computed.
  60. ULONG _RankMethod; // Method for computing rank.
  61. int _iCur; // Cursor index for Hit/NextHit.
  62. };