summaryrefslogtreecommitdiffstats
path: root/obj-types.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-29 17:13:21 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-29 17:13:21 +0000
commitb494d54b98e6240a20f494ecaa0bad646c531686 (patch)
treedc407c4e253a86cff008d042900e723b1aeca09e /obj-types.h
parent5f8b43e12ae8e42e1cb9eed7692f6f53ea279ff8 (diff)
downloadrsyslog-b494d54b98e6240a20f494ecaa0bad646c531686.tar.gz
rsyslog-b494d54b98e6240a20f494ecaa0bad646c531686.tar.xz
rsyslog-b494d54b98e6240a20f494ecaa0bad646c531686.zip
converted conf.c to an abstract class
Diffstat (limited to 'obj-types.h')
-rw-r--r--obj-types.h27
1 files changed, 24 insertions, 3 deletions
diff --git a/obj-types.h b/obj-types.h
index ad8c555c..31fdd03d 100644
--- a/obj-types.h
+++ b/obj-types.h
@@ -166,7 +166,8 @@ rsRetVal objName##ClassInit(void) \
CHKiRet(objGetObjInterface(&obj)); /* this provides the root pointer for all other queries */ \
} \
CHKiRet(obj.InfoConstruct(&pObjInfoOBJ, (uchar*) #objName, objVers, \
- (rsRetVal (*)(void*))objName##Construct, (rsRetVal (*)(void*))objName##Destruct,\
+ (rsRetVal (*)(void*))objName##Construct,\
+ (rsRetVal (*)(void*))objName##Destruct,\
(rsRetVal (*)(interface_t*))objName##QueryInterface));
#define ENDObjClassInit(objName) \
@@ -175,6 +176,26 @@ finalize_it: \
RETiRet; \
}
+/* ... and now the same for abstract classes.
+ * TODO: consolidate the two -- rgerhards, 2008-02-29
+ */
+#define BEGINAbstractObjClassInit(objName, objVers, objType) \
+rsRetVal objName##ClassInit(void) \
+{ \
+ DEFiRet; \
+ if(objType == OBJ_IS_CORE_MODULE) { \
+ CHKiRet(objGetObjInterface(&obj)); /* this provides the root pointer for all other queries */ \
+ } \
+ CHKiRet(obj.InfoConstruct(&pObjInfoOBJ, (uchar*) #objName, objVers, \
+ NULL,\
+ NULL,\
+ (rsRetVal (*)(interface_t*))objName##QueryInterface));
+
+#define ENDObjClassInit(objName) \
+ iRet = obj.RegisterObj((uchar*)#objName, pObjInfoOBJ); \
+finalize_it: \
+ RETiRet; \
+}
/* this defines both the constructor and initializer
* rgerhards, 2008-01-10
@@ -345,8 +366,8 @@ finalize_it: \
* functions that actually need to be non-static.
*/
#define PROTOTYPEObj(obj) \
- PROTOTYPEObjClassInit(obj); \
- //PROTOTYPEObjQueryInterface(obj)
+ PROTOTYPEObjClassInit(obj);
+
/* ------------------------------ end object loader system ------------------------------ */