home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-21 | 2.9 KB | 96 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWExcept.cpp
- // Release Version: $ 1.0d1 $
- //
- // Creation Date: 3/28/94
- //
- // Copyright: © 1994 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWEXCEPT_H
- #include "FWExcept.h"
- #endif
-
- #ifndef FWPRIMEM_H
- #include "FWPriMem.h"
- #endif
-
- #ifndef FWPRIDEB_H
- #include "FWPriDeb.h"
- #endif
-
- #include <stddef.h>
-
- #ifdef FW_BUILD_MAC
- #pragma segment BEL
- #endif
-
- //========================================================================================
- // CLASS _FW_CException
- //========================================================================================
-
- _FW_EXCEPTION_IMPLEMENT_ROOT(_FW_CException)
-
- //----------------------------------------------------------------------------------------
- // _FW_CException::operator new
- //----------------------------------------------------------------------------------------
- void* _FW_CException::operator new(size_t /* size */)
- {
- FW_PRIV_ASSERT(FALSE); // exceptions should be on the stack
- return NULL;
- }
-
-
- //----------------------------------------------------------------------------------------
- // _FW_CException::operator delete
- //----------------------------------------------------------------------------------------
- void _FW_CException::operator delete(void* /* memory */)
- {
- FW_PRIV_ASSERT(FALSE); // exceptions should be on the stack
- }
-
- //----------------------------------------------------------------------------------------
- // _FW_CException::_FW_CException
- //----------------------------------------------------------------------------------------
- _FW_CException::_FW_CException()
- {
- #ifdef FW_DEBUG
- fIsValid = 1;
- #endif
- }
-
- //----------------------------------------------------------------------------------------
- // _FW_CException::~_FW_CException
- //----------------------------------------------------------------------------------------
- _FW_CException::~_FW_CException()
- {
- #ifdef FW_DEBUG
- FW_PRIV_ASSERT(fIsValid==1);
- fIsValid = 0;
- #endif
- }
-
- //----------------------------------------------------------------------------------------
- // _FW_CException::__IsKindOf()
- //----------------------------------------------------------------------------------------
-
- int _FW_CException::__IsKindOf(FW_ClassReference aClass)
- {
- FW_PRIV_ASSERT(fIsValid==1);
- return PrivVirtualGetClassInfo()->IsKindOf(aClass);
- }
-
- //----------------------------------------------------------------------------------------
- // _FW_CException::Copy(void *p)
- //----------------------------------------------------------------------------------------
- void _FW_CException::Copy(void *p, size_t maxObjectSize) const
- {
- FW_PRIV_ASSERT(fIsValid==1);
- size_t objectSize = GetSize();
- FW_PRIV_ASSERT(objectSize <= maxObjectSize);
- FW_PrimitiveCopyMemory(this, p, objectSize);
- }
-
-