home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Found / FWExcLib / Sources / FWBreakC.cpp < prev    next >
Encoding:
Text File  |  1995-11-08  |  2.7 KB  |  110 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWBreakC.cpp
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    (c) 1993, 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #include "FWFound.hpp"
  11.  
  12. #ifndef   FWEXCRUN_H
  13. #include "FWExcRun.h"
  14. #endif
  15.  
  16. #ifndef   FWBREAKC_H
  17. #include "FWBreakC.h"
  18. #endif
  19.  
  20. #ifndef FWEXCDEF_H
  21. #include "FWExcDef.h"
  22. #endif
  23.  
  24. #ifndef FWPRIEXC_H
  25. #include "FWPriExc.h"
  26. #endif
  27.  
  28. #if FW_LIB_EXPORT_PRAGMAS
  29. #pragma lib_export on
  30. #endif
  31.  
  32. #ifdef FW_BUILD_MAC
  33. #pragma segment BEL
  34. #endif
  35.  
  36. //========================================================================================
  37. // CLASS FW_CExceptionThrowPoint
  38. //========================================================================================
  39.  
  40. #ifdef FW_DEBUG
  41.  
  42. FW_CExceptionThrowPoint * FW_CExceptionThrowPoint::gFirst = NULL;
  43.  
  44. FW_CExceptionThrowPoint::FW_CExceptionThrowPoint (const char * name)
  45. :    fName (name)
  46. {
  47.     // insert ourself into the global linked list of throwpoints
  48.     fPrevious = NULL;
  49.     fNext = gFirst;
  50.     if (fNext)
  51.         fNext->fPrevious = this;
  52.     gFirst = this;
  53. }
  54.  
  55. FW_CExceptionThrowPoint::~FW_CExceptionThrowPoint ()
  56. {
  57.     if (fPrevious)
  58.         fPrevious->fNext = fNext;
  59.     if (fNext)
  60.         fNext->fPrevious = fPrevious;
  61.     if (gFirst == this)
  62.         gFirst = fNext;
  63. }
  64.  
  65. void 
  66. FW_CExceptionThrowPoint::Check ()
  67. {
  68.     fHasBeenChecked = TRUE;
  69.     if (fThrowWhenChecked)
  70.         FW_Failure(FW_xUnknownError);
  71. }
  72.  
  73. FW_CExceptionThrowPoint* FW_CExceptionThrowPoint::First()
  74. {
  75.     return gFirst;
  76. }
  77.  
  78. #endif // FW_DEBUG
  79.  
  80. #ifndef FW_NATIVE_EXCEPTIONS
  81.  
  82. //========================================================================================
  83. // CLASS FW_CExceptionBreakContext
  84. //========================================================================================
  85.  
  86. //----------------------------------------------------------------------------------------
  87. // FW_CExceptionBreakContext::FW_CExceptionBreakContext
  88. //----------------------------------------------------------------------------------------
  89. #ifdef FW_DEBUG
  90. FW_CExceptionBreakContext::FW_CExceptionBreakContext(FW_ClassInfoPtr breakExceptionKind) :
  91.     fLastBreakExceptionKind(FW_CPrivExceptionRuntime::SetBreakOnThrow(breakExceptionKind))
  92. {
  93.     FW_END_CONSTRUCTOR
  94. }
  95. #endif
  96.  
  97. //----------------------------------------------------------------------------------------
  98. // FW_CExceptionBreakContext::~FW_CExceptionBreakContext
  99. //----------------------------------------------------------------------------------------
  100. #ifdef FW_DEBUG
  101. FW_CExceptionBreakContext::~FW_CExceptionBreakContext()
  102. {
  103.     FW_START_DESTRUCTOR
  104.     FW_CPrivExceptionRuntime::SetBreakOnThrow(fLastBreakExceptionKind);
  105. }
  106. #endif
  107.  
  108.  
  109. #endif // FW_NATIVE_EXCEPTIONS
  110.