diff -r 000000000000 -r b16258d2340f applayerpluginsandutils/uripermissionservices/server/inc/StreamObjContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/applayerpluginsandutils/uripermissionservices/server/inc/StreamObjContainer.h Tue Feb 02 01:09:52 2010 +0200 @@ -0,0 +1,62 @@ +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// SqlSrvObjContainer.h +// +// + +#ifndef __INETSRVSTREAMOBJCONTAINER_H__ +#define __INETSRVSTREAMOBJCONTAINER_H__ + +#include + +/** +Indexed storage for server side URI stream objects. + + +@internalComponent +*/ + +template class RStreamObjContainer + { +public: + RStreamObjContainer(); + void Close(); + void AllocL(); + TInt Add(T* aObj); + void Remove(TInt aHandle); + T* Find(TInt aHandle) const; + TInt Count() const; + +private: + TInt MakeHandle(TInt aIndex) const; + TInt MakeIndex(TInt aHandle) const; + +private: + struct TEntry + { + T* iObj; + TInt iNext; + }; + enum {KGranularity = 16}; + //KMaxSize value depends on how many bits are used for handles - see + //KStmtHandleMask and KStreamHandleMask in SqlUtil.h file. + enum {KMaxSize = 0x7FF}; + TEntry* iEntries; + TInt iSize; + TInt iFree; + }; + +#include "StreamObjContainer.inl" + +#endif//__INETSRVSTREAMOBJCONTAINER_H__