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.

98 lines
2.0 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved.
  3. Module Name:
  4. WsbCollectable.h
  5. Abstract:
  6. Abstract classes that provide methods that allow the derived objects to
  7. be stored in collections.
  8. Author:
  9. Chuck Bardeen [cbardeen] 29-Oct-1996
  10. Revision History:
  11. --*/
  12. #include "WsbPstbl.h"
  13. #ifndef _WSBCLTBL_
  14. #define _WSBCLTBL_
  15. /*++
  16. Class Name:
  17. CWsbObject
  18. Class Description:
  19. Base class for collectable objects that are persistable
  20. to/from a stream.
  21. --*/
  22. class WSB_EXPORT CWsbObject :
  23. public CWsbPersistStream,
  24. public IWsbCollectable,
  25. public IWsbTestable
  26. {
  27. // CComObjectRoot
  28. public:
  29. STDMETHOD(FinalConstruct)(void);
  30. void FinalRelease(void);
  31. // IWsbCollectable
  32. public:
  33. STDMETHOD(CompareTo)(IUnknown* pCollectable, SHORT* pResult);
  34. STDMETHOD(IsEqual)(IUnknown* pCollectable);
  35. };
  36. #define WSB_FROM_CWSBOBJECT \
  37. STDMETHOD(IsEqual)(IUnknown* pObject) \
  38. {return(CWsbObject::IsEqual(pObject));}
  39. /*++
  40. Class Name:
  41. CWsbCollectable
  42. Class Description:
  43. Base class for collectable objects that are persistable
  44. to/from stream, storage, or file. CWsbObject should be used instead of
  45. this object unless storage and/or file persistence is absolutely necessary!
  46. If the object is persisted as part of a parent
  47. object, then only the parent object (or its parent) needs to support
  48. persistence to storage and/or file.
  49. --*/
  50. class WSB_EXPORT CWsbCollectable :
  51. public CWsbPersistable,
  52. public IWsbCollectable,
  53. public IWsbTestable
  54. {
  55. // CComObjectRoot
  56. public:
  57. STDMETHOD(FinalConstruct)(void);
  58. void FinalRelease(void);
  59. // IWsbCollectable
  60. public:
  61. STDMETHOD(CompareTo)(IUnknown* pCollectable, SHORT* pResult);
  62. STDMETHOD(IsEqual)(IUnknown* pCollectable);
  63. };
  64. #define WSB_FROM_CWSBCOLLECTABLE \
  65. STDMETHOD(IsEqual)(IUnknown* pCollectable) \
  66. {return(CWsbCollectable::IsEqual(pCollectable));}
  67. #endif // _WSBCLTBL_