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.

59 lines
1.6 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1992.
  5. //
  6. // File: KCURHEAP.CXX
  7. //
  8. // Contents: Implementations for the Cursor Heaps for CMergeCursor,
  9. // CWlCursor, and CSynCursor.
  10. //
  11. // History: 20-Jan-92 BartoszM and AmyA Created
  12. //
  13. // Notes: This code was previously located in mcursor.cxx and
  14. // wlcursor.cxx.
  15. //
  16. //----------------------------------------------------------------------------
  17. #include <pch.cxx>
  18. #pragma hdrstop
  19. #include <wcurheap.hxx>
  20. #include "kcurheap.hxx"
  21. //+---------------------------------------------------------------------------
  22. //
  23. // Function: KeyLessThan
  24. //
  25. // Synopsis: Compares keys in cursors
  26. //
  27. // Arguments: [c1] -- cursor 1
  28. // [c2] -- cursor 2
  29. //
  30. // History: 06-May-91 BartoszM Created
  31. //
  32. //----------------------------------------------------------------------------
  33. inline BOOL KeyLessThan ( CKeyCursor* c1, CKeyCursor* c2 )
  34. {
  35. Win4Assert ( c1 != 0 );
  36. Win4Assert ( c2 != 0 );
  37. Win4Assert ( c1->GetKey() != 0 );
  38. Win4Assert ( c2->GetKey() != 0 );
  39. return ( Compare (c1->GetKey(), c2->GetKey()) < 0);
  40. }
  41. // Implement CKeyHeap, a heap of cursors ordered according to keys
  42. IMP_HEAP ( CKeyHeap, CKeyCursor, KeyLessThan )
  43. // Implement CIdxWidHeap, a heap of cursors ordered according to work id's
  44. IMP_HEAP ( CIdxWidHeap, CKeyCursor, WidLessThan )
  45. // Implement COccHeapofKeyCur, a heap of key cursors ordered according to
  46. // occurrences
  47. IMP_HEAP ( COccHeapOfKeyCur, CKeyCursor, OccLessThan )