00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __CEXCEPTION_H
00019 #define __CEXCEPTION_H
00020
00021 #include <stdarg.h>
00022 #include "defs.h"
00023 #include "util.h"
00024
00025 class cObject;
00026 class cModule;
00027
00031 class SIM_API cException
00032 {
00033 protected:
00034 int errorcode;
00035 opp_string msg;
00036 opp_string modulefullpath;
00037 int moduleid;
00038
00044 void init(const cObject *obj, int errc, const char *fmt, va_list va);
00045
00046
00047 void storeCtx();
00048
00049 public:
00055 cException();
00056
00062 cException(int errcode,...);
00063
00067 cException(const char *msg,...);
00068
00076 cException(const cObject *where, int errcode,...);
00077
00083 cException(const cObject *where, const char *msg,...);
00085
00088
00092 int errorCode() {return errorcode;}
00093
00097 const char *message() {return msg;}
00098
00103 const char *moduleFullPath() {return modulefullpath;}
00104
00111 int moduleID() {return moduleid;}
00112
00113
00114
00115
00116
00118
00119
00128 class SIM_API cTerminationException : public cException
00129 {
00130 public:
00136 cTerminationException(int errcode,...);
00137
00141 cTerminationException(const char *msg,...);
00142 };
00143
00151 class SIM_API cEndModuleException : public cException
00152 {
00153 private:
00154 bool del;
00155
00156 public:
00160 cEndModuleException(bool moduleToBeDeleted=false) {del = moduleToBeDeleted;}
00161
00165 bool moduleToBeDeleted() {return del;}
00166 };
00167
00168 #endif