From 494641793c437f2806978481f623da4d5a3527c6 Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Wed, 8 Aug 2007 14:15:57 +0000 Subject: [PATCH] convenience macros for checking amarg type git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@421 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- core/AmArg.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/core/AmArg.h b/core/AmArg.h index ac2d73ec..0b9974bd 100644 --- a/core/AmArg.h +++ b/core/AmArg.h @@ -120,6 +120,23 @@ class AmArg #define isArgCStr(a) (AmArg::CStr == a.getType()) #define isArgAObject(a) (AmArg::AObject == a.getType()) +#define assertArgArray(a) \ + if (!isArgArray(a)) \ + throw AmArg::TypeMismatchException(); +#define assertArgDouble(a) \ + if (!isArgDouble(a)) \ + throw AmArg::TypeMismatchException(); +#define assertArgInt(a) \ + if (!isArgInt(a)) \ + throw AmArg::TypeMismatchException(); +#define assertArgCStr(a) \ + if (!isArgCStr(a)) \ + throw AmArg::TypeMismatchException(); +#define assertArgAObject(a) \ + if (!isArgAObject(a)) \ + throw AmArg::TypeMismatchException(); + + void setBorrowedPointer(ArgObject* v) { type = AObject; v_obj = v;