home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 2.7 KB | 110 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWBreakC.cpp
- // Release Version: $ 1.0d11 $
- //
- // Copyright: (c) 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "FWFound.hpp"
-
- #ifndef FWEXCRUN_H
- #include "FWExcRun.h"
- #endif
-
- #ifndef FWBREAKC_H
- #include "FWBreakC.h"
- #endif
-
- #ifndef FWEXCDEF_H
- #include "FWExcDef.h"
- #endif
-
- #ifndef FWPRIEXC_H
- #include "FWPriExc.h"
- #endif
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- #ifdef FW_BUILD_MAC
- #pragma segment BEL
- #endif
-
- //========================================================================================
- // CLASS FW_CExceptionThrowPoint
- //========================================================================================
-
- #ifdef FW_DEBUG
-
- FW_CExceptionThrowPoint * FW_CExceptionThrowPoint::gFirst = NULL;
-
- FW_CExceptionThrowPoint::FW_CExceptionThrowPoint (const char * name)
- : fName (name)
- {
- // insert ourself into the global linked list of throwpoints
- fPrevious = NULL;
- fNext = gFirst;
- if (fNext)
- fNext->fPrevious = this;
- gFirst = this;
- }
-
- FW_CExceptionThrowPoint::~FW_CExceptionThrowPoint ()
- {
- if (fPrevious)
- fPrevious->fNext = fNext;
- if (fNext)
- fNext->fPrevious = fPrevious;
- if (gFirst == this)
- gFirst = fNext;
- }
-
- void
- FW_CExceptionThrowPoint::Check ()
- {
- fHasBeenChecked = TRUE;
- if (fThrowWhenChecked)
- FW_Failure(FW_xUnknownError);
- }
-
- FW_CExceptionThrowPoint* FW_CExceptionThrowPoint::First()
- {
- return gFirst;
- }
-
- #endif // FW_DEBUG
-
- #ifndef FW_NATIVE_EXCEPTIONS
-
- //========================================================================================
- // CLASS FW_CExceptionBreakContext
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CExceptionBreakContext::FW_CExceptionBreakContext
- //----------------------------------------------------------------------------------------
- #ifdef FW_DEBUG
- FW_CExceptionBreakContext::FW_CExceptionBreakContext(FW_ClassInfoPtr breakExceptionKind) :
- fLastBreakExceptionKind(FW_CPrivExceptionRuntime::SetBreakOnThrow(breakExceptionKind))
- {
- FW_END_CONSTRUCTOR
- }
- #endif
-
- //----------------------------------------------------------------------------------------
- // FW_CExceptionBreakContext::~FW_CExceptionBreakContext
- //----------------------------------------------------------------------------------------
- #ifdef FW_DEBUG
- FW_CExceptionBreakContext::~FW_CExceptionBreakContext()
- {
- FW_START_DESTRUCTOR
- FW_CPrivExceptionRuntime::SetBreakOnThrow(fLastBreakExceptionKind);
- }
- #endif
-
-
- #endif // FW_NATIVE_EXCEPTIONS
-