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.

88 lines
2.6 KiB

  1. // ExceptionContext.cpp -- ExceptionContext class implementation
  2. // (c) Copyright Schlumberger Technology Corp., unpublished work, created
  3. // 1999. This computer program includes Confidential, Proprietary
  4. // Information and is a Trade Secret of Schlumberger Technology Corp. All
  5. // use, disclosure, and/or reproduction is prohibited unless authorized
  6. // in writing. All Rights Reserved.
  7. #include "ExceptionContext.h"
  8. using namespace std;
  9. using namespace scu;
  10. /////////////////////////// LOCAL/HELPER /////////////////////////////////
  11. /////////////////////////// PUBLIC /////////////////////////////////
  12. // Types
  13. // C'tors/D'tors
  14. ExceptionContext::ExceptionContext()
  15. : m_apexception(0)
  16. {}
  17. ExceptionContext::~ExceptionContext()
  18. {}
  19. // Operators
  20. // Operations
  21. void
  22. ExceptionContext::Exception(std::auto_ptr<scu::Exception const> &rapexc)
  23. {
  24. m_apexception = rapexc;
  25. }
  26. void
  27. ExceptionContext::ClearException()
  28. {
  29. m_apexception = std::auto_ptr<scu::Exception const>(0);
  30. }
  31. void
  32. ExceptionContext::PropagateException()
  33. {
  34. scu::Exception const *pexc = Exception();
  35. if (pexc)
  36. pexc->Raise();
  37. }
  38. void
  39. ExceptionContext::PropagateException(std::auto_ptr<scu::Exception const> &rapexc)
  40. {
  41. Exception(rapexc);
  42. PropagateException();
  43. }
  44. // Access
  45. scu::Exception const *
  46. ExceptionContext::Exception() const
  47. {
  48. return m_apexception.get();
  49. }
  50. // Predicates
  51. // Static Variables
  52. /////////////////////////// PROTECTED /////////////////////////////////
  53. // C'tors/D'tors
  54. // Operators
  55. // Operations
  56. // Access
  57. // Predicates
  58. // Static Variables
  59. /////////////////////////// PRIVATE /////////////////////////////////
  60. // C'tors/D'tors
  61. // Operators
  62. // Operations
  63. // Access
  64. // Predicates
  65. // Static Variables