From 5c686c8adcc473cbdbb14e4b2d736f9123210ee6 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 24 Jan 2008 17:55:09 +0000 Subject: redesigned queue to utilize helper classes for threading support. This is finally in a running state for regular (non disk-assisted) queues, with a minor nit at shutdown. So I can finally commit the work again to CVS... --- obj-types.h | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) (limited to 'obj-types.h') diff --git a/obj-types.h b/obj-types.h index 9d430b72..7eff503d 100644 --- a/obj-types.h +++ b/obj-types.h @@ -58,9 +58,11 @@ typedef enum { /* IDs of known object "types/classes" */ OBJNull = 0, /* no valid object (we do not start at zero so we can detect calloc()) */ OBJMsg = 1, OBJstrm = 2, - OBJqueue = 3 /* remeber to UPDATE OBJ_NUM_IDS (below) if you add one! */ + OBJwtp = 3, + OBJwti = 4, + OBJqueue = 5 /* remeber to UPDATE OBJ_NUM_IDS (below) if you add one! */ } objID_t; -#define OBJ_NUM_IDS 4 +#define OBJ_NUM_IDS 6 typedef enum { /* IDs of base methods supported by all objects - used for jump table, so * they must start at zero and be incremented. -- rgerahrds, 2008-01-04 @@ -114,6 +116,31 @@ typedef struct obj { /* the dummy struct that each derived class can be casted t # define ISOBJ_assert(pObj) #endif +#define DEFpropSetMethPTR(obj, prop, dataType)\ + rsRetVal obj##Set##prop(obj##_t *pThis, dataType *pVal)\ + { \ + /* DEV debug: dbgprintf("%sSet%s()\n", #obj, #prop); */\ + pThis->prop = pVal; \ + return RS_RET_OK; \ + } +#define PROTOTYPEpropSetMethPTR(obj, prop, dataType)\ + rsRetVal obj##Set##prop(obj##_t *pThis, dataType*) +#define DEFpropSetMeth(obj, prop, dataType)\ + rsRetVal obj##Set##prop(obj##_t *pThis, dataType pVal)\ + { \ + /* DEV debug: dbgprintf("%sSet%s()\n", #obj, #prop); */\ + pThis->prop = pVal; \ + return RS_RET_OK; \ + } +#define DEFpropSetMethFP(obj, prop, dataType)\ + rsRetVal obj##Set##prop(obj##_t *pThis, dataType)\ + { \ + /* DEV debug: dbgprintf("%sSet%s()\n", #obj, #prop); */\ + pThis->prop = pVal; \ + return RS_RET_OK; \ + } +#define PROTOTYPEpropSetMethFP(obj, prop, dataType)\ + rsRetVal obj##Set##prop(obj##_t *pThis, dataType) #define DEFpropSetMeth(obj, prop, dataType)\ rsRetVal obj##Set##prop(obj##_t *pThis, dataType pVal)\ { \ @@ -135,7 +162,7 @@ rsRetVal objName##ClassInit(void) \ #define ENDObjClassInit(objName) \ objRegisterObj(OBJ##objName, pObjInfoOBJ); \ finalize_it: \ - return iRet; \ + RETiRet; \ } /* this defines both the constructor and initializer @@ -148,7 +175,7 @@ finalize_it: \ #define ENDobjConstruct(obj) \ /* use finalize_it: before calling the macro (if you need it)! */ \ - return iRet; \ + RETiRet; \ } \ rsRetVal obj##Construct(obj##_t **ppThis) \ { \ @@ -166,8 +193,9 @@ finalize_it: \ \ finalize_it: \ OBJCONSTRUCT_CHECK_SUCCESS_AND_CLEANUP \ - return iRet; \ + RETiRet; \ } + #endif /* #ifndef OBJ_TYPES_H_INCLUDED */ -- cgit