Changeset 40:ec5dde8a6ff6 in xplra for src/client/c/hu/varadiistvan/xplra/Exception.h
- Timestamp:
- 02/14/13 18:21:47 (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/client/c/hu/varadiistvan/xplra/Exception.h
r19 r40 143 143 INVALID_ID = 7, 144 144 145 /// Invalid duration 146 INVALID_DURATION = 8, 147 145 148 /// Other error 146 149 OTHER = 255 … … 153 156 errorCode_t errorCode; 154 157 158 /** 159 * Indicate if the parameter is valid. 160 */ 161 bool hasParameter; 162 163 /** 164 * Parameter of the error. 165 */ 166 long parameter; 167 155 168 public: 156 169 /** 157 170 * Construct the exception. 158 171 */ 159 ProtocolException(errorCode_t errorCode) throw(); 172 ProtocolException(errorCode_t errorCode, 173 bool hasParameter = false, long parameter = 0) throw(); 160 174 161 175 /** … … 163 177 */ 164 178 errorCode_t getErrorCode() const throw(); 179 180 /** 181 * Get the value of the parameter and whether it is valid or not. 182 */ 183 bool getParameter(long& param) const throw(); 165 184 }; 166 185 … … 246 265 { 247 266 return errorCode; 267 } 268 269 //------------------------------------------------------------------------------ 270 271 inline bool ProtocolException::getParameter(long& param) const throw() 272 { 273 if (hasParameter) param = parameter; 274 return hasParameter; 248 275 } 249 276
Note:
See TracChangeset
for help on using the changeset viewer.