61 void ReName(
const char*);
62 static void PrintTrace();
63 static void AddTrace();
76 static void AddMessage(
const char* a_what);
78 static void AddInt(
int value);
81 static const char*
what() {
return what_error; }
85 #ifdef TypeDefException 90 : entry(e), previous(last) {
last =
this; }
96 #ifdef SimulateExceptions // SimulateExceptions 121 JumpItem() : ji(JumpBase::jl), trace(0), janitor(0)
122 { JumpBase::jl =
this; }
123 ~JumpItem() { JumpBase::jl = ji; }
131 if (!setjmp( JumpBase::jl->env )) { \ 132 JumpBase::jl->trace = Tracer::last; \ 133 JumpItem JI387256156; 135 #define ReThrow Throw() 137 #define Catch(EXCEPTION) \ 138 } else if (BaseException::Select == EXCEPTION::Select) { 140 #define CatchAll } else 142 #define CatchAndThrow } else Throw(); 150 static bool do_not_link;
164 class JanitorInitializer
167 JanitorInitializer();
169 static int ref_count;
172 static JanitorInitializer JanInit;
174 #endif // end of SimulateExceptions 179 #define Throw(E) throw E 180 #define ReThrow throw 182 #define CatchAll catch(...) 183 #define CatchAndThrow {} 185 #endif // end of UseExceptions 188 #ifdef DisableExceptions // Disable exceptions 191 #define ReThrow Throw() 192 #define Catch(EXCEPTION) } if (false) { 193 #define CatchAll } if (false) 194 #define CatchAndThrow } 200 #endif // end of DisableExceptions 202 #ifndef SimulateExceptions // ! SimulateExceptions 212 #endif // end of ! SimulateExceptions 217 #ifdef DO_FREE_CHECK // DO_FREE_CHECK 228 virtual void Report()=0;
229 friend class FreeCheck;
232 class FCLClass :
public FreeCheckLink
235 FCLClass(
void* t,
char* name);
237 friend class FreeCheck;
240 class FCLRealArray :
public FreeCheckLink
244 FCLRealArray(
void* t,
char* o,
int s);
246 friend class FreeCheck;
249 class FCLIntArray :
public FreeCheckLink
253 FCLIntArray(
void* t,
char* o,
int s);
255 friend class FreeCheck;
261 static FreeCheckLink* next;
262 static int BadDelete;
264 static void Register(
void*,
char*);
265 static void DeRegister(
void*,
char*);
266 static void RegisterR(
void*,
char*,
int);
267 static void DeRegisterR(
void*,
char*,
int);
268 static void RegisterI(
void*,
char*,
int);
269 static void DeRegisterI(
void*,
char*,
int);
270 static void Status();
271 friend class FreeCheckLink;
272 friend class FCLClass;
273 friend class FCLRealArray;
274 friend class FCLIntArray;
277 #define FREE_CHECK(Class) \ 279 void* operator new(size_t size) \ 281 void* t = ::operator new(size); FreeCheck::Register(t,#Class); \ 284 void operator delete(void* t) \ 285 { FreeCheck::DeRegister(t,#Class); ::operator delete(t); } 288 #ifdef SimulateExceptions // SimulateExceptions 290 #define NEW_DELETE(Class) \ 292 void* operator new(size_t size) \ 295 void* t = ::operator new(size); FreeCheck::Register(t,#Class); \ 298 void operator delete(void* t) \ 299 { FreeCheck::DeRegister(t,#Class); ::operator delete(t); } 302 #endif // end of SimulateExceptions 305 #define MONITOR_REAL_NEW(Operation, Size, Pointer) \ 306 FreeCheck::RegisterR(Pointer, Operation, Size); 307 #define MONITOR_INT_NEW(Operation, Size, Pointer) \ 308 FreeCheck::RegisterI(Pointer, Operation, Size); 309 #define MONITOR_REAL_DELETE(Operation, Size, Pointer) \ 310 FreeCheck::DeRegisterR(Pointer, Operation, Size); 311 #define MONITOR_INT_DELETE(Operation, Size, Pointer) \ 312 FreeCheck::DeRegisterI(Pointer, Operation, Size); 314 #else // DO_FREE_CHECK not defined 316 #define FREE_CHECK(Class) public: 317 #define MONITOR_REAL_NEW(Operation, Size, Pointer) {} 318 #define MONITOR_INT_NEW(Operation, Size, Pointer) {} 319 #define MONITOR_REAL_DELETE(Operation, Size, Pointer) {} 320 #define MONITOR_INT_DELETE(Operation, Size, Pointer) {} 323 #ifdef SimulateExceptions // SimulateExceptions 326 #define NEW_DELETE(Class) \ 328 void* operator new(size_t size) \ 329 { do_not_link=true; void* t = ::operator new(size); return t; } \ 330 void operator delete(void* t) { ::operator delete(t); } 332 #endif // end of SimulateExceptions 334 #endif // end of ! DO_FREE_CHECK 336 #ifndef SimulateExceptions // ! SimulateExceptions 338 #define NEW_DELETE(Class) FREE_CHECK(Class) 340 #endif // end of ! SimulateExceptions 427 #endif // end of EXCEPTION_LIB
static unsigned long Select
static unsigned long Select
static unsigned long Select
Invalid_argument(const char *a_what=0)
Out_of_range(const char *a_what=0)
Domain_error(const char *a_what=0)
static unsigned long Select
Bad_alloc(const char *a_what=0)
static unsigned long Select
static unsigned long Select
static unsigned long Select
static unsigned long Select
Runtime_error(const char *a_what=0)
Overflow_error(const char *a_what=0)
Range_error(const char *a_what=0)
static const char * what()
static unsigned long Select
Logic_error(const char *a_what=0)
void ReName(const char *)
static unsigned long Select
Length_error(const char *a_what=0)