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.

75 lines
2.0 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // dsenum.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // This file declares the class DBEnumerator.
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 02/20/1998 Original version.
  16. //
  17. ///////////////////////////////////////////////////////////////////////////////
  18. #ifndef _DSENUM_H_
  19. #define _DSENUM_H_
  20. #include <dsobject.h>
  21. #include <objcmd.h>
  22. #include <oledbstore.h>
  23. ///////////////////////////////////////////////////////////////////////////////
  24. //
  25. // CLASS
  26. //
  27. // DBEnumerator
  28. //
  29. // DESCRIPTION
  30. //
  31. // This class implements IEnumVARIANT for a rowset of objects.
  32. //
  33. ///////////////////////////////////////////////////////////////////////////////
  34. class DBEnumerator : public IEnumVARIANT
  35. {
  36. public:
  37. DBEnumerator(DBObject* container, IRowset* members);
  38. ~DBEnumerator() { Bind::releaseAccessor(items, readAccess); }
  39. //////////
  40. // IUnknown
  41. //////////
  42. STDMETHOD_(ULONG, AddRef)();
  43. STDMETHOD_(ULONG, Release)();
  44. STDMETHOD(QueryInterface)(const IID& iid, void** ppv);
  45. //////////
  46. // IEnumVARIANT
  47. //////////
  48. STDMETHOD(Next)(/*[in]*/ ULONG celt,
  49. /*[length_is][size_is][out]*/ VARIANT* rgVar,
  50. /*[out]*/ ULONG* pCeltFetched);
  51. STDMETHOD(Skip)(/*[in]*/ ULONG celt);
  52. STDMETHOD(Reset)();
  53. STDMETHOD(Clone)(/*[out]*/ IEnumVARIANT** ppEnum);
  54. protected:
  55. LONG refCount; // Interface ref count.
  56. CComPtr<DBObject> parent; // The container being enumerated.
  57. Rowset items; // Items in the container.
  58. HACCESSOR readAccess; // Accessor for reading rows.
  59. ULONG identity; // Identity buffer.
  60. WCHAR name[OBJECT_NAME_LENGTH]; // Name buffer.
  61. BEGIN_BIND_MAP(DBEnumerator, ReadAccessor, DBACCESSOR_ROWDATA)
  62. BIND_COLUMN(identity, 1, DBTYPE_I4),
  63. BIND_COLUMN(name, 2, DBTYPE_WSTR)
  64. END_BIND_MAP()
  65. };
  66. #endif // _DSENUM_H_