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.

106 lines
2.2 KiB

  1. #ifndef _DFBASIS_HXX_
  2. #define _DFBASIS_HXX_
  3. //+--------------------------------------------------------------
  4. //
  5. // Class: CDFBasis (dfb)
  6. //
  7. // Purpose: Defines base variables for sharing between exposed
  8. // DocFiles
  9. //
  10. //---------------------------------------------------------------
  11. #include "h/ole.hxx"
  12. interface CExposedDocFile;
  13. class CDFBasis
  14. {
  15. public:
  16. inline CDFBasis();
  17. inline ~CDFBasis();
  18. inline CExposedDocFile* GetCopyBase(void);
  19. inline void SetCopyBase(CExposedDocFile *pdf);
  20. inline void AddRef();
  21. inline void Release();
  22. private:
  23. CExposedDocFile* _pdfCopyBase;
  24. ULONG _ulRef;
  25. };
  26. //+--------------------------------------------------------------
  27. //
  28. // Member: CDFBasis::CDFBasis, public
  29. //
  30. //---------------------------------------------------------------
  31. inline CDFBasis::CDFBasis(void)
  32. {
  33. _pdfCopyBase=NULL;
  34. _ulRef= 0;
  35. }
  36. //+--------------------------------------------------------------
  37. //
  38. // Member: CDFBasis::~CDFBasis, public
  39. //
  40. //---------------------------------------------------------------
  41. inline CDFBasis::~CDFBasis(void)
  42. {
  43. }
  44. //+--------------------------------------------------------------
  45. //
  46. // Member: CDFBasis::GetCopyBase, public
  47. //
  48. // Synopsis: Returns _pdfCopyBase
  49. //
  50. //---------------------------------------------------------------
  51. inline CExposedDocFile *CDFBasis::GetCopyBase(void)
  52. {
  53. return _pdfCopyBase;
  54. }
  55. //+--------------------------------------------------------------
  56. //
  57. // Member: CDFBasis::SetCopyBase, public
  58. //
  59. // Synopsis: Sets _pdfCopyBase
  60. //
  61. //---------------------------------------------------------------
  62. inline void CDFBasis::SetCopyBase(CExposedDocFile *pdf)
  63. {
  64. _pdfCopyBase = pdf;
  65. }
  66. //+--------------------------------------------------------------
  67. //
  68. // Member: CDFBasis::AddRef, Public
  69. //
  70. //---------------------------------------------------------------
  71. inline void CDFBasis::AddRef()
  72. {
  73. _ulRef++;
  74. }
  75. //+--------------------------------------------------------------
  76. //
  77. // Member: CDFBasis::SetCopyBase, public
  78. //
  79. //---------------------------------------------------------------
  80. inline void CDFBasis::Release()
  81. {
  82. _ulRef--;
  83. olAssert(_ulRef>=0);
  84. if (_ulRef==0)
  85. delete this;
  86. }
  87. #endif // #ifndef _DFBASIS_HXX_