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.

37 lines
665 B

  1. #ifndef __FAXLOCALPTR_H_
  2. #define __FAXLOCALPTR_H_
  3. #include "FaxCommon.h"
  4. #include "faxutil.h"
  5. //
  6. //================== FAX SMART PTR -- LOCAL VERSION ==================================
  7. //
  8. template <typename T>
  9. class CFaxPtrLocal : public CFaxPtrBase<T>
  10. {
  11. protected:
  12. virtual void Free()
  13. {
  14. DBG_ENTER(_T("CFaxPtrLocal::Free()"), _T("PTR:%ld"), p);
  15. if (p)
  16. {
  17. MemFree(p);
  18. p = NULL;
  19. }
  20. }
  21. public:
  22. virtual ~CFaxPtrLocal()
  23. {
  24. Free();
  25. }
  26. T* operator=(T* lp)
  27. {
  28. DBG_ENTER(_T("CFaxPtrLocal::operator=()"));
  29. return CFaxPtrBase<T>::operator=(lp);
  30. }
  31. };
  32. #endif // __FAXLOCALPTR_H_