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.

162 lines
5.5 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved
  3. Module Name:
  4. RmsDrCls.h
  5. Abstract:
  6. Declaration of the CRmsDriveClass class
  7. Author:
  8. Brian Dodd [brian] 15-Nov-1996
  9. Revision History:
  10. --*/
  11. #ifndef _RMSDRCLS_
  12. #define _RMSDRCLS_
  13. #include "resource.h" // resource symbols
  14. #include "RmsObjct.h" // CRmsComObject
  15. /*++
  16. Class Name:
  17. CRmsDriveClass
  18. Class Description:
  19. A CRmsDriveClass holds administrative properties associated with a drive, more
  20. typically a grouping of drives that are of equal performance characteristics,
  21. and capabilities. These properties include current mount limits, and Cartridge
  22. idle time specifications that indicate when an inactive Cartridge should be
  23. returned to its storage location.
  24. By default a DriveClass object is created for each type of media supported by
  25. the drives in a library. Multi-functions drives will be associated with multiple
  26. drive classes.
  27. A DriveClass maintains a collection of drives that are associated with the DriveClass.
  28. --*/
  29. class CRmsDriveClass :
  30. public CComDualImpl<IRmsDriveClass, &IID_IRmsDriveClass, &LIBID_RMSLib>,
  31. public CRmsComObject,
  32. public CWsbObject, // inherits CComObjectRoot
  33. public CComCoClass<CRmsDriveClass,&CLSID_CRmsDriveClass>
  34. {
  35. public:
  36. CRmsDriveClass() {}
  37. BEGIN_COM_MAP(CRmsDriveClass)
  38. COM_INTERFACE_ENTRY2(IDispatch, IRmsDriveClass)
  39. COM_INTERFACE_ENTRY(IRmsDriveClass)
  40. COM_INTERFACE_ENTRY(IRmsComObject)
  41. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  42. COM_INTERFACE_ENTRY2(IPersist, IPersistStream)
  43. COM_INTERFACE_ENTRY(IPersistStream)
  44. COM_INTERFACE_ENTRY(IWsbCollectable)
  45. COM_INTERFACE_ENTRY(IWsbPersistStream)
  46. COM_INTERFACE_ENTRY(IWsbTestable)
  47. END_COM_MAP()
  48. DECLARE_REGISTRY_RESOURCEID(IDR_RmsDriveClass)
  49. // CComObjectRoot
  50. public:
  51. STDMETHOD(FinalConstruct)(void);
  52. // IPersist
  53. public:
  54. STDMETHOD(GetClassID)(CLSID *pClsid);
  55. // IPersistStream
  56. public:
  57. STDMETHOD(GetSizeMax)(ULARGE_INTEGER* pSize);
  58. STDMETHOD(Load)(IStream* pStream);
  59. STDMETHOD(Save)(IStream* pStream, BOOL clearDirty);
  60. // IWsbCollectable
  61. public:
  62. STDMETHOD(CompareTo)(IUnknown* pCollectable, SHORT* pResult);
  63. WSB_FROM_CWSBOBJECT;
  64. // IWsbTestable
  65. public:
  66. STDMETHOD(Test)(USHORT *pPassed, USHORT *pFailed);
  67. // IRmsDriveClass
  68. public:
  69. STDMETHOD(GetDriveClassId)(GUID *pDriveClassId);
  70. STDMETHOD(GetName)(BSTR *pName);
  71. STDMETHOD(SetName)(BSTR name);
  72. STDMETHOD(GetType)(LONG *pType);
  73. STDMETHOD(SetType)(LONG type);
  74. STDMETHOD(GetCapability)(LONG *pCapability);
  75. STDMETHOD(SetCapability)(LONG capability);
  76. STDMETHOD(GetIdleTime)(LONG *pTime);
  77. STDMETHOD(SetIdleTime)(LONG time);
  78. STDMETHOD(GetMountWaitTime)(LONG *pTime);
  79. STDMETHOD(SetMountWaitTime)(LONG time);
  80. STDMETHOD(GetMountLimit)(LONG *pLim);
  81. STDMETHOD(SetMountLimit)(LONG lim);
  82. STDMETHOD(GetQueuedRequests)(LONG *pReqs);
  83. STDMETHOD(SetQueuedRequests)(LONG reqs);
  84. STDMETHOD(GetUnloadPauseTime)(LONG *pTime);
  85. STDMETHOD(SetUnloadPauseTime)(LONG time);
  86. STDMETHOD(GetDriveSelectionPolicy)(LONG *pPolicy);
  87. STDMETHOD(SetDriveSelectionPolicy)(LONG policy);
  88. STDMETHOD(GetDrives)(IWsbIndexedCollection **ptr);
  89. private:
  90. enum { // Class specific constants:
  91. //
  92. Version = 1, // Class version, this should be
  93. // incremented each time the
  94. // the class definition changes.
  95. }; //
  96. RmsMedia m_type; // The type of media (only one type per
  97. // DriveClass) supported by the
  98. // DriveClass (see RmsMedia).
  99. RmsMode m_capability; // The capability of the drives
  100. // associated with a DriveClass
  101. // (see RmsMode).
  102. LONG m_idleTime; // Elapsed milliseconds before an idle
  103. // Cartridge is returned to its storage
  104. // location.
  105. LONG m_mountWaitTime; // Elapsed milliseconds to wait before
  106. // timming out a mount request for
  107. // drive in a DriveClass.
  108. LONG m_mountLimit; // The max number of parallel mount requests.
  109. LONG m_queuedRequests; // The number of outstanding requests
  110. // for drive resources in a
  111. // DriveClass.
  112. LONG m_unloadPauseTime; // Elapsed milliseconds to wait before
  113. // moving a Cartridge from a drive
  114. // associated with a DriveClass.
  115. // This is required for dumb devices.
  116. RmsDriveSelect m_driveSelectionPolicy; // The drive selection policy used
  117. // when selecting drives associated
  118. // with a DriveClass (see RmsDriveSelect).
  119. CComPtr<IWsbIndexedCollection> m_pDrives; // The drives associates with a DriveClass.
  120. };
  121. #endif // _RMSDRCLS_