From c9cf18477b3919a1e8935ce7e8e18651e2e54fa6 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 1 Mar 2000 21:21:36 +0000 Subject: [PATCH] removed RTTI --- src/libCom/misc/locationException.h | 42 +++++++++-------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/src/libCom/misc/locationException.h b/src/libCom/misc/locationException.h index a0bd1b069..583cc0c1d 100644 --- a/src/libCom/misc/locationException.h +++ b/src/libCom/misc/locationException.h @@ -15,59 +15,43 @@ #include "cantProceed.h" template -class locationAndType : public T { +class sourceFileLocation : public T { public: - locationAndType (T &, const char *fileName, unsigned lineNumber); - unsigned lineNumber () const; + sourceFileLocation (T &parm, const char *fileName, unsigned lineNumber); const char *fileName () const; - const type_info & typeInfo () const; - void show (unsigned level) const; + unsigned lineNumber () const; private: - unsigned lineNumberCopy; const char *pFileName; + unsigned lineNumberCopy; }; template -inline locationAndType::locationAndType (T &tIn, const char *fileName, unsigned lineNumber) : - T (tIn) , lineNumberCopy(lineNumber), pFileName (fileName) {} +inline sourceFileLocation::sourceFileLocation (const T &parm, const char *fileName, unsigned lineNumber) : + T (parm), pFileName (fileName) , lineNumberCopy(lineNumber) {} template -inline unsigned locationAndType::lineNumber () const +inline unsigned sourceFileLocation::lineNumber () const { return this->lineNumberCopy; } template -inline const char * locationAndType::fileName () const +inline const char * sourceFileLocation::fileName () const { return this->pFileName; } -template -inline const type_info & locationAndType::typeInfo () const -{ - return typeid (T); -} - -template -inline void locationAndType::show (unsigned level) const -{ - cerr << "C++ exception=" << typeid(T).name() - << " in file=" << this->pFileName - << " at line=" << this->lineNumberCopy; -} - #define throwWithLocation(parm) throwExceptionWithLocation (parm, __FILE__, __LINE__); -template inline void throwExceptionWithLocation (T &parm, const char *pFileName, unsigned lineNo) { - locationAndType lat (parm, pFileName, lineNo); # ifdef noExceptionsFromCXX - lat.show (UINT_MAX); + cerr << "C++ exception in file=" << pFileName + << " at line=" << lineNo + << " - cant continue"; cantProceed ("No compiler support for C++ exception"); -# else - throw lat; +# else + throw sourceFileLocation (parm, pFileName, lineNo); # endif }