|
||||
File indexing completed on 2025-01-18 09:54:33
0001 #ifndef ZMEXHANDLER_ICC 0002 #error "Exceptions/ZMexHandler.icc included without Exceptions/ZMexHandler.h" 0003 #endif 0004 0005 0006 // ---------------------------------------------------------------------- 0007 // 0008 // ZMexHandler.icc -- inline implementations for the standard handlers. 0009 // 0010 // 0011 // The following methods are defined here: 0012 // takeCareOf() and clone() for each provided handler: 0013 // ZMexThrowAlways ::takeCareOf() and ::clone() 0014 // ZMexIgnoreAlways ::takeCareOf() and ::clone() 0015 // ZMexIgnoreNextN ::takeCareOf() and ::clone() 0016 // ZMexThrowErrors and ::clone() 0017 // ZMexParentHandler::takeCareOf() and ::clone() 0018 // 0019 // Other implementations are in ZMexHandler.cc 0020 // 0021 // Revision History: 0022 // 970910 MF Initial version 0023 // 970917 WEB Updated per code review 2 0024 // 980617 WEB Added namespace support 0025 // 0026 // ---------------------------------------------------------------------- 0027 0028 0029 namespace zmex { 0030 0031 0032 //******************************************* 0033 // 0034 // takeCareOf() for various standard exceptions 0035 // 0036 // This operator provides the handler's functionality; in general, it must: 0037 // record the handler's name 0038 // obtain (via x.OKtoLog() ) permission, from the exception, to log; 0039 // if granted, invoke the exception's logger (via x.logMe() ) 0040 // decide on an action 0041 // record (via x.wasThrown() ) the determined action 0042 // return the determined action 0043 // 0044 //******************************************* 0045 0046 0047 0048 //****************************** 0049 // 0050 // ZMexThrowAlways::takeCareOf() 0051 // 0052 //****************************** 0053 0054 inline ZMexAction ZMexThrowAlways::takeCareOf( const ZMexception & x ) { 0055 //DEBUG cerr << "ThrowAlways::takeCareOf" << endl; 0056 return standardHandling( x, true ); 0057 } 0058 0059 0060 //******************************* 0061 // 0062 // ZMexIgnoreAlways::takeCareOf() 0063 // 0064 //******************************* 0065 0066 inline ZMexAction ZMexIgnoreAlways::takeCareOf( const ZMexception & x ) { 0067 //DEBUG cerr << "IgnoreAlways::takeCareOf" << endl; 0068 return standardHandling( x, false ); 0069 } 0070 0071 0072 0073 //****************************** 0074 // 0075 // ZMexIgnoreNextN::takeCareOf() 0076 // 0077 //****************************** 0078 0079 inline ZMexAction ZMexIgnoreNextN::takeCareOf( const ZMexception & x ) { 0080 0081 return standardHandling( x, ( countDown_ <= 0 ) ? true 0082 : (--countDown_, false) 0083 ); 0084 } 0085 0086 0087 //******************************** 0088 // 0089 // ZMexParentHandler::takeCareOf() 0090 // 0091 //******************************** 0092 0093 inline ZMexAction ZMexHandleViaParent::takeCareOf( const ZMexception & ) { 0094 //DEBUG cerr << "HandleViaParent::takeCareOf" << endl; 0095 return ZMexHANDLEVIAPARENT; 0096 } 0097 0098 0099 //******************************************* 0100 // 0101 // clone() for various standard exceptions 0102 // 0103 //******************************************* 0104 0105 0106 0107 //************************* 0108 // 0109 // ZMexThrowAlways::clone() 0110 // 0111 //************************* 0112 0113 inline ZMexThrowAlways * ZMexThrowAlways::clone() const { 0114 0115 return new ZMexThrowAlways( *this ); 0116 } 0117 0118 0119 //************************** 0120 // 0121 // ZMexIgnoreAlways::clone() 0122 // 0123 //************************** 0124 0125 inline ZMexIgnoreAlways * ZMexIgnoreAlways::clone() const { 0126 0127 return new ZMexIgnoreAlways( *this ); 0128 } 0129 0130 0131 0132 //************************** 0133 // 0134 // ZMexThrowErrors::clone() 0135 // 0136 //************************** 0137 0138 inline ZMexThrowErrors * ZMexThrowErrors::clone() const { 0139 0140 return new ZMexThrowErrors( *this ); 0141 } 0142 0143 0144 //************************* 0145 // 0146 // ZMexIgnoreNextN::clone() 0147 // 0148 //************************* 0149 0150 inline ZMexIgnoreNextN * ZMexIgnoreNextN::clone() const { 0151 0152 return new ZMexIgnoreNextN( *this ); 0153 } 0154 0155 0156 //*************************** 0157 // 0158 // ZMexParentHandler::clone() 0159 // 0160 //*************************** 0161 0162 inline ZMexHandleViaParent * ZMexHandleViaParent::clone() const { 0163 0164 return new ZMexHandleViaParent( *this ); 0165 } 0166 0167 0168 } // namespace zmex
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |