BIE |
/home/weinberg/src/BIE/include/BIEException.h00001 #ifndef BIEException_h 00002 #define BIEException_h 00003 00004 #include <string> 00005 #include <sstream> 00006 #include <netcdf.h> 00007 00008 using namespace std; 00009 00010 namespace BIE { 00011 00014 class BIEException { 00015 public: 00017 BIEException(string exceptionname, string message, 00018 string sourcefilename, int sourcelinenumber); 00020 BIEException(const BIEException& e); 00022 virtual ~BIEException() {} 00024 string getErrorMessage(); 00025 00026 protected: 00028 BIEException(string sourcefile, int linenumber); 00030 string exceptionname; 00032 ostringstream errormessage; 00033 00034 protected: 00036 string sourcefilename; 00038 int sourcelinenumber; 00039 }; 00040 00042 class InternalError : public BIEException { 00043 public: 00045 00046 InternalError(string sourcefilename, int sourcelinenumber); 00047 InternalError(string msg, string sourcefilename, int sourcelinenumber); 00048 InternalError(int err, string msg, string sourcefilename, int sourcelinenumber); 00050 }; 00051 00052 class RecordType; 00053 class BasicType; 00054 00056 class TypeException : public BIEException { 00057 public: 00062 TypeException(BasicType * attempted, BasicType* actual, 00063 string sourcefilename, int sourcelinenumber); 00065 TypeException(RecordType * inputtype, RecordType * expectedtype, 00066 string sourcefilename, int sourcelinenumber); 00068 TypeException(BasicType * unsupported, string sourcefilename, int sourcelinenumber); 00070 TypeException(string error, string sourcefilename, int sourcelinenumber); 00071 }; 00072 00074 class NoValueException : public BIEException { 00075 public: 00077 NoValueException(string sourcefilename, int sourcelinenumber); 00078 }; 00079 00081 class NoSuchFieldException : public BIEException { 00082 public: 00084 NoSuchFieldException(string fieldname,string sourcefilename, int sourcelinenumber); 00086 NoSuchFieldException(int fieldindex,string sourcefilename, int sourcelinenumber); 00087 }; 00088 00090 class NotSetInputException : public BIEException { 00091 public: 00093 NotSetInputException(int inputindex, string sourcefilename, int sourcelinenumber); 00094 }; 00095 00097 class NotScalarInputException : public BIEException { 00098 public: 00100 NotScalarInputException(int inputindex, string sourcefilename, int sourcelinenumber); 00101 }; 00102 00104 class NoSuchFilterInputException : public BIEException { 00105 public: 00107 NoSuchFilterInputException(int inputindex,string sourcefilename, int sourcelinenumber); 00109 NoSuchFilterInputException(string inputname, string sourcefilename, int sourcelinenumber); 00110 }; 00111 00113 class NoSuchFilterOutputException : public BIEException { 00114 public: 00116 NoSuchFilterOutputException(int outputindex, string sourcefilename, int sourcelinenumber); 00118 NoSuchFilterOutputException(string outputname, string sourcefilename, int sourcelinenumber); 00119 }; 00120 00122 class BadRangeException : public BIEException { 00123 public: 00125 BadRangeException(int startindex, int endindex, 00126 string sourcefilename, int sourcelinenumber); 00127 }; 00128 00130 class NameClashException : public BIEException{ 00131 public: 00133 NameClashException(string clashname, string sourcefilename, int sourcelinenumber); 00134 }; 00135 00137 class DuplicateFieldException : public BIEException { 00138 public: 00140 DuplicateFieldException(int fieldindex, string sourcefilename, int sourcelinenumber); 00142 DuplicateFieldException(string fieldname, string sourcefilename, int sourcelinenumber); 00143 }; 00144 00146 class StreamInheritanceException : public BIEException { 00147 public: 00149 StreamInheritanceException(string sourcefilename, int sourcelinenumber); 00150 }; 00151 00153 class FileOpenException : public BIEException { 00154 public: 00156 FileOpenException(string filename, int errno_, string sourcefilename, int sourcelinenumber); 00157 }; 00158 00160 class FileCreateException : public BIEException { 00161 public: 00163 FileCreateException(string filename, int errno_, string sourcefilename, int sourcelinenumber); 00164 }; 00165 00167 class FileFormatException : public BIEException { 00168 public: 00170 FileFormatException(string message, string sourcefilename, int sourcelinenumber); 00171 }; 00172 00174 class EndofStreamException : public BIEException { 00175 public: 00177 EndofStreamException(string sourcefilename, int sourcelinenumber); 00178 }; 00179 00181 class NotRootException : public BIEException { 00182 public: 00184 NotRootException(string sourcefilename, int sourcelinenumber); 00185 }; 00186 00188 class NoSuchConnection : public BIEException { 00189 public: 00191 NoSuchConnection(string sourcefilename, int sourcelinenumber); 00192 }; 00193 00195 class UnusableFilterException : public BIEException { 00196 public: 00198 UnusableFilterException(string sourcefilename, int sourcelinenumber); 00199 }; 00200 00202 class AttachedFilterException : public BIEException { 00203 public: 00205 AttachedFilterException(string sourcefilename, int sourcelinenumber); 00206 }; 00207 00209 class InsertPositionException : public BIEException { 00210 public: 00212 InsertPositionException(int insertpos, string sourcefilename, int sourcelinenumber); 00213 }; 00214 00216 class InvalidStreamIDException : public BIEException { 00217 public: 00219 InvalidStreamIDException(int streamid, string sourcefilename, int sourcelinenumber); 00220 }; 00221 00223 class CliException : public BIEException { 00224 public: 00226 CliException(string message, string sourcefilename, int sourcelinenumber); 00227 }; 00228 00230 class ClassNotExistException: public CliException { 00231 public: 00233 ClassNotExistException(const char *class_name, string sourcefilename, int sourcelinenumber); 00234 }; 00235 00237 class MethodCallOnNonObjectException : public BIEException { 00238 public: 00240 MethodCallOnNonObjectException(string sourcefilename, int sourcelinenumber); 00241 }; 00242 00244 class MethodNotExistException: public BIEException { 00245 public: 00247 MethodNotExistException(const char *method_name, string sourcefilename, int sourcelinenumber); 00248 }; 00249 00251 class MethodDiffArgException: public CliException { 00252 public: 00254 MethodDiffArgException(const char *method_name, string sourcefilename, int sourcelinenumber); 00255 }; 00256 00258 class MethodDiffRetTypeException: public CliException { 00259 public: 00261 MethodDiffRetTypeException(const char *method_name, string sourcefilename, int sourcelinenumber); 00262 }; 00263 00265 class TypeMisArgException: public CliException { 00266 public: 00268 TypeMisArgException(string sourcefilename, int sourcelinenumber); 00269 }; 00270 00272 class VarNotExistException: public BIEException { 00273 public: 00275 VarNotExistException(string var, string sourcefilename, int sourcelinenumber); 00276 }; 00277 00279 class TypeMisMatchException: public BIEException { 00280 public: 00282 TypeMisMatchException(string sourcefilename, int sourcelinenumber); 00283 }; 00284 00286 class EvalExprException: public BIEException { 00287 public: 00289 EvalExprException(string sourcefilename, int sourcelinenumber); 00290 }; 00291 00293 class PriorException: public BIEException { 00294 public: 00296 PriorException(const char *error_msg, string sourcefilename, int sourcelinenumber); 00297 }; 00298 00300 class FileNotExistException: public BIEException { 00301 public: 00303 FileNotExistException(string error_msg, string filename, string sourcefilename, int sourcelinenumber); 00304 }; 00305 00307 class DimNotSupportException: public BIEException { 00308 public: 00310 DimNotSupportException(string sourcefilename, int sourcelinenumber); 00311 }; 00312 00314 class TypeNotSupportException: public BIEException { 00315 public: 00317 TypeNotSupportException(string type, string sourcefilename, int sourcelinenumber); 00318 }; 00319 00321 class DimNotMatchException: public BIEException { 00322 public: 00324 DimNotMatchException(string sourcefilename, int sourcelinenumber); 00326 DimNotMatchException(string msg, 00327 string sourcefilename, int sourcelinenumber); 00328 }; 00329 00331 class DirichletValueException: public BIEException { 00332 public: 00334 DirichletValueException(string sourcefilename, int sourcelinenumber); 00335 }; 00336 00338 class DirichletSumException: public BIEException { 00339 public: 00341 DirichletSumException(double val, string sourcefilename, int sourcelinenumber); 00342 }; 00343 00345 class DirichletMomException: public BIEException { 00346 public: 00348 DirichletMomException(string sourcefilename, int sourcelinenumber); 00349 }; 00350 00352 class MixPriorTypeException: public BIEException { 00353 public: 00355 MixPriorTypeException(int type, string sourcefilename, int sourcelinenumber); 00356 }; 00357 00359 class DimValueException: public BIEException { 00360 public: 00362 DimValueException(string sourcefilename, int sourcelinenumber); 00363 }; 00364 00366 class TessellationOverlapException: public BIEException { 00367 public: 00369 TessellationOverlapException(string sourcefilename, int sourcelinenumber); 00370 }; 00371 00373 class KSDistanceException : public BIEException { 00374 public: 00376 KSDistanceException(string sourcefilename, int sourcelinenumber); 00378 KSDistanceException(int distindex, int dimensions, 00379 string sourcefilename, int sourcelinenumber); 00381 KSDistanceException(int distoneindex, RecordType * distonetype, 00382 int disttwoindex, RecordType * disttwotype, 00383 string sourcefilename, int sourcelinenumber); 00384 }; 00385 00387 class DataSetFieldException : public BIEException { 00388 public: 00390 DataSetFieldException(string field, string msg, 00391 string sourcefilename, int sourcelinenumber); 00392 }; 00393 00395 class StringBufferOverflowException : public BIEException { 00396 public: 00398 StringBufferOverflowException 00399 (int bufferlen, int requiredlen, string sourcefilename, int sourcelinenumber); 00400 }; 00401 00403 class NetCDFException : public BIEException { 00404 public: 00409 NetCDFException(int ncstatus, string sourcefilename, int sourcelinenumber); 00410 }; 00411 00413 class NetCDFFormatException : public BIEException { 00414 public: 00416 NetCDFFormatException (string varname, int varid, int vardim, 00417 string netcdffilename, 00418 string sourcefilename, int sourcelinenumber); 00423 NetCDFFormatException (string varname, int varid, string netcdffilename, 00424 string sourcefilename, int sourcelinenumber); 00425 00427 NetCDFFormatException (string varname, int varid, string netcdffilename, 00428 nc_type vartype, string sourcefilename, 00429 int sourcelinenumber); 00430 00432 NetCDFFormatException (string fieldname, int fieldindex, 00433 string sourcefilename, int sourcelinenumber); 00434 }; 00435 00437 class GetTypeException : public BIEException { 00438 public: 00440 GetTypeException(int status, string sourcefilename, int sourcelinenumber); 00441 }; 00442 00444 class TileIDException : public BIEException { 00445 public: 00450 TileIDException (int tileid, int mintileid, int maxtileid, 00451 string sourcefilename, int sourcelinenumber); 00452 }; 00453 00458 class InvalidFrontierException : public BIEException { 00459 public: 00461 InvalidFrontierException(string sourcefilename, int sourcelinenumber); 00462 }; 00463 00465 class NoSuchDistributionException : public BIEException { 00466 public: 00468 NoSuchDistributionException(string sourcefilename, int sourcelinenumber); 00469 }; 00470 00472 class NoPointDistributionException : public BIEException { 00473 public: 00475 NoPointDistributionException(string sourcefilename, int sourcelinenumber); 00476 }; 00477 00479 class NoBinnedDistributionException : public BIEException { 00480 public: 00482 NoBinnedDistributionException(string sourcefilename, int sourcelinenumber); 00483 }; 00484 00486 class InappropriateDistributionException : public BIEException { 00487 public: 00489 InappropriateDistributionException(string stype, string sourcefilename, int sourcelinenumber); 00490 }; 00491 00493 class TessToolException : public BIEException { 00494 public: 00496 TessToolException(string msg, string sourcefilename, int sourcelinenumber); 00497 }; 00498 00500 class ImpossibleStateException : public BIEException { 00501 public: 00503 ImpossibleStateException(string sourcefilename, int sourcelinenumber); 00505 ImpossibleStateException(string msg, 00506 string sourcefilename, int sourcelinenumber); 00507 }; 00508 00510 class MetropolisHastingsException : public BIEException { 00511 public: 00513 MetropolisHastingsException(string file, string sourcefilename, int sourcelinenumber); 00514 }; 00515 00516 00518 class StateCreateException : public BIEException { 00519 public: 00521 StateCreateException(unsigned idim, 00522 string sourcefilename, int sourcelinenumber); 00523 }; 00524 00526 class StateBoundsException : public BIEException { 00527 public: 00529 StateBoundsException(unsigned indx, unsigned dmax, 00530 string sourcefilename, int sourcelinenumber); 00531 }; 00532 00534 class ResumeLogException : public BIEException { 00535 public: 00537 ResumeLogException(string message, 00538 string sourcefilename, int sourcelinenumber); 00539 }; 00540 00542 class BadParameterException : public BIEException { 00543 public: 00545 BadParameterException(string classname, string message, 00546 string sourcefilename, int sourcelinenumber); 00547 }; 00548 00549 } 00550 00551 00552 #endif Send suggestions, questions, and feedback to WEINBERG at ASTRO dot UMASS dot EDU. Documentation generated at Fri Mar 26 00:35:09 2010 by
|