diff -r 0659d0e1a03c -r 1d28c8722707 userlibandfileserver/fileserver/sfile/sf_pool.cpp --- a/userlibandfileserver/fileserver/sfile/sf_pool.cpp Wed Oct 20 13:58:28 2010 +0100 +++ b/userlibandfileserver/fileserver/sfile/sf_pool.cpp Tue Nov 02 15:29:23 2010 +0000 @@ -23,13 +23,13 @@ //=====CFsPool============================= template -CFsPool* CFsPool::New(TInt aPoolSize) +CFsPool* CFsPool::New(TInt aPoolSize, T*(*aNewFunction)()) { CFsPool* pool = new CFsPool(); if(!pool) return NULL; - TInt r = pool->Construct(aPoolSize); + TInt r = pool->Construct(aPoolSize,aNewFunction); if(r!=KErrNone) { delete pool; @@ -46,20 +46,20 @@ } template -TInt CFsPool::Construct(TInt aPoolSize) +TInt CFsPool::Construct(TInt aPoolSize,T*(*aNewFunction)()) { - TInt r = iPoolLock.CreateLocal(KNotificationPoolSize); + TInt r = iPoolLock.CreateLocal(aPoolSize); if(r != KErrNone) return r; - r = iFreeList.Reserve(KNotificationPoolSize); + r = iFreeList.Reserve(aPoolSize); if(r != KErrNone) return r; TInt i = 0; while(i < aPoolSize) { - T* t = T::New(); + T* t = aNewFunction(); if(!t) { return KErrNoMemory; @@ -120,9 +120,9 @@ iPoolLock.Signal(); } +//These are needed here because the compiler needs to know which types will be +//instantiating the template (because it's in a separate file) #ifdef SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION -//This is needed here because the compiler needs to know which types will be -//instantiating the template (because it's in a separate file) template class CFsPool; #endif //SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION - +template class CFsPool;