00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef IXLIB_EXGEN
00011 #define IXLIB_EXGEN
00012
00013
00014
00015
00016 #include <ixlib_exbase.hh>
00017
00018
00019
00020
00021
00022 #define EC_CANNOTEVALUATE 0
00023 #define EC_NOTYETIMPLEMENTED 1
00024 #define EC_ERROR 2
00025 #define EC_NULLPOINTER 3
00026 #define EC_INVALIDPAR 4
00027 #define EC_INDEX 5
00028 #define EC_BUFFEROVERFLOW 6
00029 #define EC_BUFFERUNDERFLOW 7
00030 #define EC_ITEMNOTFOUND 8
00031 #define EC_INVALIDOP 9
00032 #define EC_DIMENSIONMISMATCH 10
00033 #define EC_CANCELLED 11
00034 #define EC_EMPTYSET 12
00035 #define EC_CANNOTREMOVEFROMGC 13
00036 #define EC_REMAININGREF 14
00037
00038 #define ECMEM_GENERAL 0
00039
00040
00041
00042
00043 #define EXGEN_THROW(CODE)\
00044 EX_THROW(generic,CODE)
00045 #define EXGEN_THROWINFO(CODE,INFO)\
00046 EX_THROWINFO(generic,CODE,INFO)
00047 #define EXGEN_NYI\
00048 EXGEN_THROW(EC_NOTYETIMPLEMENTED)
00049 #define EXMEM_THROW(BYTES)\
00050 throw memory_exception(ECMEM_GENERAL,BYTES,__FILE__,__LINE__);
00051 #define EX_MEMCHECK(PTR)\
00052 if (!PTR) EXMEM_THROW(sizeof(*PTR));
00053
00054
00055
00056
00057 namespace ixion {
00058
00059 struct generic_exception : public base_exception {
00060 generic_exception(TErrorCode error,char const *info = NULL,char *module = NULL,
00061 TIndex line = 0)
00062 : base_exception(error,info,module,line,"GEN") {
00063 }
00064 virtual char const *getText() const;
00065 };
00066
00067
00068 struct memory_exception : public base_exception {
00069 memory_exception(TErrorCode error,TSize bytesmissing = 0,char *module = NULL,
00070 TIndex line = 0);
00071 virtual char const *getText() const;
00072 };
00073 }
00074
00075
00076
00077
00078 #endif