1 // Conditions (a.k.a. exceptions)
3 #ifndef _CL_CONDITION_H
4 #define _CL_CONDITION_H
6 #include "cln/malloc.h"
13 void* operator new (size_t size) { return malloc_hook(size); }
15 void operator delete (void* ptr) { free_hook(ptr); }
17 virtual const char * name () const = 0;
19 virtual void print (std::ostream&) const = 0;
20 // Virtual destructor.
21 virtual ~cl_condition () = 0;
23 virtual void dummy ();
25 #define SUBCLASS_cl_condition() \
28 void* operator new (size_t size) { return malloc_hook(size); } \
30 void operator delete (void* ptr) { free_hook(ptr); }
32 // Functions which want to raise a condition return a `cl_condition*'.
33 // The caller checks this value. NULL means no condition. The one who
34 // disposes the condition (handles it without resignalling it) should
35 // call `delete' on the condition pointer.
39 #endif /* _CL_CONDITION_H */