diff --git a/src/libCom/misc/locationException.h b/src/libCom/misc/locationException.h index cc18ef0bc..a0bd1b069 100644 --- a/src/libCom/misc/locationException.h +++ b/src/libCom/misc/locationException.h @@ -17,7 +17,7 @@ template class locationAndType : public T { public: - locationAndType (T &); + locationAndType (T &, const char *fileName, unsigned lineNumber); unsigned lineNumber () const; const char *fileName () const; const type_info & typeInfo () const; @@ -28,36 +28,36 @@ private: }; template -inline locationAndType::locationAndType (T &tIn, const char *fileName, unsigned lineNumber) : +inline locationAndType::locationAndType (T &tIn, const char *fileName, unsigned lineNumber) : T (tIn) , lineNumberCopy(lineNumber), pFileName (fileName) {} template -inline unsigned locationAndType::lineNumber () const +inline unsigned locationAndType::lineNumber () const { return this->lineNumberCopy; } template -inline const char * locationAndType::typeInfo () const +inline const char * locationAndType::fileName () const +{ + return this->pFileName; +} + +template +inline const type_info & locationAndType::typeInfo () const { return typeid (T); } template -inline const char * locationAndType::lineNumber () const -{ - return this->lineNumberCopy; -} - -template -inline const char * locationAndType::show (unsigned level) const +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__); +#define throwWithLocation(parm) throwExceptionWithLocation (parm, __FILE__, __LINE__); template inline void throwExceptionWithLocation (T &parm, const char *pFileName, unsigned lineNo)