From dd575394dba4f1943a5185a5f40750a4293b7203 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 11 Jan 2008 14:34:53 +0000 Subject: support for object property bags added --- queue.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'queue.c') diff --git a/queue.c b/queue.c index 0d59a068..91d89b06 100644 --- a/queue.c +++ b/queue.c @@ -46,6 +46,7 @@ #include "obj.h" /* static data */ +DEFobjStaticHelpers /* methods */ @@ -498,6 +499,7 @@ rsRetVal queueConstruct(queue_t **ppThis, queueType_t qType, int iWorkerThreads, } /* we have an object, so let's fill the properties */ + objConstructSetObjInfo(pThis); if((pThis->pszSpoolDir = (uchar*) strdup((char*)glblGetWorkDir())) == NULL) ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); @@ -633,6 +635,10 @@ static rsRetVal queuePersist(queue_t *pThis) CHKiRet(strmSetFName(psQIF, pszQIFNam, lenQIFNam)); CHKiRet(strmConstructFinalize(psQIF)); + /* first, write the property bag for ourselfs */ + CHKiRet(objBeginSerializePropBag(psQIF, (obj_t*) pThis)); + CHKiRet(objEndSerialize(psQIF)); + /* this is disk specific and must be moved to a function */ CHKiRet(strmSerialize(pThis->tVars.disk.pWrite, psQIF)); CHKiRet(strmSerialize(pThis->tVars.disk.pRead, psQIF)); @@ -799,6 +805,17 @@ finalize_it: /* some simple object access methods */ DEFpropSetMeth(queue, bImmediateShutdown, int); + +/* Initialize the stream class. Must be called as the very first method + * before anything else is called inside this class. + * rgerhards, 2008-01-09 + */ +BEGINObjClassInit(queue, 1) + //OBJSetMethodHandler(objMethod_SERIALIZE, strmSerialize); + //OBJSetMethodHandler(objMethod_SETPROPERTY, strmSetProperty); + //OBJSetMethodHandler(objMethod_CONSTRUCTION_FINALIZER, strmConstructFinalize); +ENDObjClassInit(strm) + /* * vi:set ai: */ -- cgit