windowing/windowserver/nonnga/remotegc/CacheBase.h
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __CACHEBASE_H__
       
    17 #define __CACHEBASE_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <e32cmn.h>
       
    21 
       
    22 /**
       
    23 A cache base-class providing basic functionality for resolving a cached item.
       
    24 */
       
    25 NONSHARABLE_CLASS(CCacheBase): public CBase
       
    26 	{	
       
    27 public:	
       
    28 	void BeginUpdate();	
       
    29 	void EndUpdate();
       
    30 
       
    31 protected:
       
    32 	CCacheBase();
       
    33 	~CCacheBase();
       
    34 	
       
    35 	virtual TInt UseL(TInt aHandle) = 0;
       
    36 	virtual const CBase* Resolve(TInt aHandle);
       
    37 	
       
    38 protected:
       
    39 	struct TCacheEntry
       
    40 		{
       
    41 		TCacheEntry(TInt aHandle)
       
    42 			{
       
    43 			iHandle = aHandle;
       
    44 			}
       
    45 			
       
    46 		TInt iHandle;
       
    47 		TBool iIsUsed;
       
    48 		CBase* iCachedItem;
       
    49 		};
       
    50 
       
    51 protected:		
       
    52 	RArray<TCacheEntry> iCachedItems;
       
    53 	};
       
    54 	
       
    55 #endif //__CACHEBASE_H__
       
    56 
       
    57 
       
    58 
       
    59