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.

141 lines
5.5 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved
  3. Module Name:
  4. RmsCElmt.h
  5. Abstract:
  6. Declaration of the CRmsChangerElement class
  7. Author:
  8. Brian Dodd [brian] 15-Nov-1996
  9. Revision History:
  10. --*/
  11. #ifndef _RMSCELMT_
  12. #define _RMSCELMT_
  13. #include "resource.h" // resource symbols
  14. #include "RmsObjct.h" // CRmsComObject
  15. #include "RmsLocat.h" // CRmsLocator
  16. /*++
  17. Class Name:
  18. CRmsChangerElement
  19. Class Description:
  20. A CRmsChangerElement represents an element within a library device. Each
  21. element can support one or more kinds of media. An element can be used
  22. for storage. Various statistics about an element are kept for an object
  23. of this type. These include the number of times a Cartridge has been put
  24. into the element or taken from (get) the element. Each element can has
  25. one owner and is specified by the ClassId of the application that configured
  26. the element.
  27. All elements within a library have spacial resolution. This is modeled by a
  28. triplete (x1, x2, x3) that provides relative physical location to other
  29. elements.
  30. --*/
  31. class CRmsChangerElement :
  32. public CComDualImpl<IRmsChangerElement, &IID_IRmsChangerElement, &LIBID_RMSLib>,
  33. public CRmsComObject
  34. {
  35. public:
  36. CRmsChangerElement();
  37. ~CRmsChangerElement();
  38. // CRmsChangerElement
  39. public:
  40. HRESULT CompareTo(IUnknown* pCollectable, SHORT* pResult);
  41. HRESULT GetSizeMax(ULARGE_INTEGER* pSize);
  42. HRESULT Load(IStream* pStream);
  43. HRESULT Save(IStream* pStream, BOOL clearDirty);
  44. HRESULT Test(USHORT *pPassed, USHORT *pFailed);
  45. // IRmsChangerElement
  46. public:
  47. STDMETHOD(GetElementNo)(LONG *pElementNo);
  48. STDMETHOD(GetLocation)(LONG *pType, GUID *pLibId, GUID *pMediaSetId, LONG *pPos, LONG *pAlt1, LONG *pAlt2, LONG *pAlt3, BOOL *pInvert);
  49. STDMETHOD(SetLocation)(LONG type, GUID libId, GUID mediaSetId, LONG pos, LONG alt1, LONG alt2, LONG alt3, BOOL invert);
  50. STDMETHOD(GetMediaSupported)(LONG *pType);
  51. STDMETHOD(SetMediaSupported)(LONG type);
  52. STDMETHOD(IsStorage)(void);
  53. STDMETHOD(SetIsStorage)(BOOL flag);
  54. STDMETHOD(IsOccupied)(void);
  55. STDMETHOD(SetIsOccupied)(BOOL flag);
  56. STDMETHOD(GetCartridge)(IRmsCartridge **ptr);
  57. STDMETHOD(SetCartridge)(IRmsCartridge *ptr);
  58. STDMETHOD(GetOwnerClassId)(CLSID *pClassId);
  59. STDMETHOD(SetOwnerClassId)(CLSID classId);
  60. STDMETHOD(GetAccessCounters)(LONG *pGets, LONG *pPuts);
  61. STDMETHOD(ResetAccessCounters)(void);
  62. STDMETHOD(GetResetCounterTimestamp)(DATE *pDate);
  63. STDMETHOD(GetLastGetTimestamp)(DATE *pDate);
  64. STDMETHOD(GetLastPutTimestamp)(DATE *pDate);
  65. STDMETHOD(GetCoordinates)(LONG *pX1, LONG *pX2, LONG *pX3);
  66. STDMETHOD(SetCoordinates)(LONG x1, LONG x2, LONG x3);
  67. protected:
  68. enum { // Class specific constants:
  69. //
  70. Version = 1, // Class version, this should be
  71. // incremented each time the
  72. // the class definition changes.
  73. }; //
  74. LONG m_elementNo; // The element number.
  75. CRmsLocator m_location; // The address of the element.
  76. RmsMedia m_mediaSupported; // The type of media supported by the
  77. // element, usually one type, but
  78. // can be a combination of media
  79. // types for multi-function devices
  80. // (i.e. drives that support Optical,
  81. // WORM, and CDR).
  82. BOOL m_isStorage; // If TRUE, the element can be used to
  83. // store a unit of media.
  84. BOOL m_isOccupied; // If TRUE, the element contains a unit of media.
  85. IRmsCartridge * m_pCartridge; // A pointer to the Cartridge object residing
  86. // within the changer element. This is not smart
  87. // pointer, since a cartridge cannot exist only
  88. // with in the context of a changer element, and
  89. // eliminates problems associated with deleting
  90. // with a backward references to other objects...
  91. CLSID m_ownerClassId; // The Class ID for the application that
  92. // currently owns the element resource.
  93. LONG m_getCounter; // The number of Cartridge-gets from this element.
  94. LONG m_putCounter; // The number of Cartridge-puts to this element.
  95. DATE m_resetCounterTimestamp; // The time the counters were reset.
  96. DATE m_lastGetTimestamp; // The date of last Cartridge-get.
  97. DATE m_lastPutTimestamp; // The date of last Cartridge-put.
  98. LONG m_x1; // x1, x2, x3 specify a spacial location
  99. LONG m_x2; // relative other elements in the library.
  100. LONG m_x3; // These are used for micro-optimizations.
  101. };
  102. #endif // _RMSCELMT_