From 4c22006b8012bafccf955c0d077971e67107ac35 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Tue, 12 Dec 2006 12:59:26 +0000 Subject: a few exception-handling convenience definitions --- diff --git a/include/konforka/exception.h b/include/konforka/exception.h index 5e0bf96..dbfe27c 100644 --- a/include/konforka/exception.h +++ b/include/konforka/exception.h @@ -26,6 +26,37 @@ #define NOCODEPOINT "no information" /** + * @def KONFORKA_RETHROW + * the convenience definition for seeing the exception and rethrowing it further. + */ +#define KONFORKA_RETHROW catch(konforka::exception& e) { e.see(CODEPOINT); throw; } + +/** + * @def KONFORKA_E_ARGS + * the convenience definition for naming codepoint parameters + */ +#define KONFORKA_E_PARS const string& fi,const string& fu,int l,const string& w + +/** + * @def KONFORKA_E_CONS + * the convenience definition for passing parameters to constructor + */ +#define KONFORKA_E_CONS fi,fu,l,w + +/** + * @def KONFORKA_E_SUBCLASS + * the convenience definition for subclassing konforka exceptions + * @param base base class + * @param derived derived class + */ +#define KONFORKA_E_SUBCLASS(derived,base) \ + class derived : public base { \ + public: \ + explicit derived(KONFORKA_E_PARS) \ + : base(KONFORKA_E_CONS) { } \ + } + +/** * @brief The main konforka namespace. */ namespace konforka { -- cgit v0.9.0.2