File indexing completed on 2025-01-18 09:54:33
0001 #ifndef ZMEXCEPTION_ICC
0002 #error "Exceptions/ZMexception.icc included without Exceptions/ZMexception.h"
0003 #endif
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 namespace zmex {
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046 inline ZMexception::ZMexception(
0047 const std::string & mesg
0048 , const ZMexSeverity howBad
0049 , int icount
0050 ) :
0051 message_(mesg)
0052 , line_( 0 )
0053 , sourceFileName_( "not ZMthrow'n as of yet" )
0054 , mySeverity_( howBad == ZMexSEVERITYenumLAST ? _classInfo.severity() : howBad )
0055 , myCount_( icount )
0056 , wasThrown_( false )
0057 { }
0058
0059
0060
0061
0062
0063
0064
0065
0066 inline std::string ZMexception::message() const {
0067 return message_;
0068 }
0069
0070
0071
0072
0073 inline int ZMexception::count() const {
0074 return myCount_;
0075 }
0076
0077
0078
0079
0080 inline bool ZMexception::wasThrown() const {
0081 return wasThrown_;
0082 }
0083
0084 inline void ZMexception::wasThrown( bool b ) const {
0085 #ifdef DEFECT_NO_MUTABLE
0086 ZMexception * localThis = const_cast<ZMexception * const>(this);
0087 localThis->wasThrown_ = b;
0088 #else
0089 wasThrown_ = b;
0090 #endif
0091 }
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101 inline std::string ZMexception::handlerUsed() const {
0102 return handlerUsed_;
0103 }
0104
0105 inline void ZMexception::handlerUsed( const std::string handlerName ) const {
0106 #ifdef DEFECT_NO_MUTABLE
0107 ZMexception * localThis = const_cast<ZMexception * const>(this);
0108 localThis->handlerUsed_ = handlerName;
0109 #else
0110 handlerUsed_ = handlerName;
0111 #endif
0112 }
0113
0114
0115
0116
0117
0118
0119 inline ZMexSeverity ZMexception::severity() const {
0120 return mySeverity_;
0121 }
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134 inline void ZMexception::location( int iline, const std::string filename ) const {
0135 #ifdef DEFECT_NO_MUTABLE
0136 ZMexception * localThis = const_cast<ZMexception * const>(this);
0137 localThis->line_ = iline;
0138 localThis->sourceFileName_ = filename;
0139 #else
0140 line_ = iline;
0141 sourceFileName_ = filename;
0142 #endif
0143 }
0144
0145 inline std::string ZMexception::fileName() const {
0146 return sourceFileName_;
0147 }
0148
0149 inline int ZMexception::line() const {
0150 return line_;
0151 }
0152
0153 inline bool ZMexception::OKtoLog() const {
0154 return classInfo().OKtoLog();
0155 }
0156
0157
0158 }