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.

82 lines
2.1 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1998.
  5. //
  6. // File: BmkAcc.hxx
  7. //
  8. // Contents: Distributed Bookmark accessor class
  9. //
  10. // Classes: CDistributedBookmarkAccessor
  11. //
  12. // History: 25-Sep-98 VikasMan Created
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include <impiunk.hxx>
  17. #include <accbase.hxx>
  18. //+---------------------------------------------------------------------------
  19. //
  20. // Class: CDistributedBookmarkAccessor
  21. //
  22. // Purpose: Contains the bookmark accessors for the child rowsets. This
  23. // is created once for a CDistributedRowset and then shared by
  24. // all the accessors for that distributed rowset
  25. //
  26. // History: 25-Sep-98 VikasMan Created
  27. //
  28. //----------------------------------------------------------------------------
  29. class CDistributedBookmarkAccessor
  30. {
  31. public:
  32. CDistributedBookmarkAccessor( IRowset ** const aCursor,
  33. unsigned cCursor,
  34. DBACCESSORFLAGS dwAccessorFlags,
  35. DBBINDSTATUS* pStatus,
  36. DBORDINAL iBookmark,
  37. DBBKMARK cbBookmark );
  38. ~CDistributedBookmarkAccessor()
  39. {
  40. _ReleaseAccessors();
  41. }
  42. unsigned GetCount()
  43. {
  44. Win4Assert( _xhaccBookmark.Count() == _xIacc.Count() );
  45. return _xhaccBookmark.Count();
  46. }
  47. IAccessor * GetIAccessor( unsigned iChild )
  48. {
  49. Win4Assert( iChild < GetCount() );
  50. return _xIacc[iChild].GetPointer();
  51. }
  52. HACCESSOR GetHAccessor( unsigned iChild )
  53. {
  54. Win4Assert( iChild < GetCount() );
  55. return _xhaccBookmark[iChild];
  56. }
  57. SCODE GetData( unsigned iChild, HROW * ahrow, void * pBookmarkData,
  58. DBBKMARK cbBookmark, IRowset * * const aCursor,
  59. ULONG cCursor, SCODE * pStatus );
  60. private:
  61. void _ReleaseAccessors();
  62. XArray<HACCESSOR> _xhaccBookmark;
  63. XArray< XInterface<IAccessor> > _xIacc;
  64. };