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.

93 lines
2.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1995 - 1998
  5. //
  6. // File: PosCache.hxx
  7. //
  8. // Contents: Positionable cache
  9. //
  10. // Classes: CMiniPositionableCache
  11. //
  12. // History: 05-Jun-95 KyleP Created
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include "pcache.hxx"
  17. //+---------------------------------------------------------------------------
  18. //
  19. // Class: CMiniPositionableCache
  20. //
  21. // Purpose: Row cache that supports random seek.
  22. //
  23. // History: 05-Jun-95 KyleP Created.
  24. //
  25. //----------------------------------------------------------------------------
  26. class CMiniPositionableCache : public PMiniRowCache
  27. {
  28. public:
  29. CMiniPositionableCache( int Index,
  30. IRowsetScroll * pRowset,
  31. unsigned cBindings,
  32. DBBINDING * pBindings,
  33. unsigned cbMaxLen,
  34. DBORDINAL iColumnBookmark,
  35. DBBKMARK cbBookmark );
  36. ~CMiniPositionableCache();
  37. //
  38. // Iteration
  39. //
  40. ENext Next( int iDir = 1 );
  41. ENext MovePrev();
  42. ENext Seek( DBROWOFFSET lRows );
  43. ENext Seek( DBBKMARK cbBookmark, BYTE const * pbBookmark );
  44. ENext Seek( DBCOUNTITEM ulNumerator, DBCOUNTITEM ulDenominator );
  45. ENext LoadPrevRowData();
  46. virtual void FlushCache();
  47. inline HROW GetPrevHROW()
  48. {
  49. return _hrowPrev;
  50. }
  51. inline BYTE * GetPrevData() const
  52. {
  53. return ( _hrowPrev != DB_NULL_HROW ? _xpbPrevRow.GetPointer() : 0 );
  54. }
  55. private:
  56. //
  57. // Controlling rowset
  58. //
  59. IRowsetScroll * _pRowsetScroll;
  60. //
  61. // Support for bookmark(s). Used for positioning.
  62. //
  63. HACCESSOR _haccBookmark; // Accessor to fetch bookmark
  64. XArray<BYTE> _pbBookmark; // Bookmark for Next.
  65. XArray<BYTE> _pbBookmarkSeek; // Bookmark for Seek.
  66. BOOL _fUsingBookmark; // TRUE when bookmark column available
  67. DBCOUNTITEM _oBookmark; // Additional rows to be added beyond
  68. // bookmark.
  69. HROW _hrowPrev; // Handle to the previous row
  70. XPtrST<BYTE> _xpbPrevRow; // Previous row data
  71. };