os/persistentdata/persistentstorage/store/INC/S32PAGE.INL
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/persistentstorage/store/INC/S32PAGE.INL	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,89 @@
     1.4 +// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +// Class TPageRef
    1.20 +inline TPageRef::TPageRef(TUint32 aValue)
    1.21 +	: iVal(aValue)
    1.22 +/** Constructor that initialises the object to a page reference value.
    1.23 +
    1.24 +@param aValue Page reference value */
    1.25 +	{}
    1.26 +inline TBool TPageRef::operator==(TPageRef aRef) const
    1.27 +/** Equality operator.
    1.28 +
    1.29 +@param aRef Page reference against which to compare
    1.30 +@return True if aRef refers to the same page as the object, otherwise false. */
    1.31 +	{return iVal==aRef.iVal;}
    1.32 +inline TBool TPageRef::operator!=(TPageRef aRef) const
    1.33 +/** Inequality operator.
    1.34 +
    1.35 +@param aRef Page reference against which to compare
    1.36 +@return True if aRef does not refer to the same page as the object, otherwise 
    1.37 +false. */
    1.38 +	{return iVal!=aRef.iVal;}
    1.39 +inline void TPageRef::ExternalizeL(RWriteStream& aStream) const
    1.40 +/** Externalises a TPageRef object to a write stream.
    1.41 +
    1.42 +@param aStream Stream to which the object should be externalised. */
    1.43 +	{aStream<<iVal;}
    1.44 +inline void TPageRef::InternalizeL(RReadStream& aStream)
    1.45 +/** Internalises a TPageRef object from a read stream.
    1.46 +
    1.47 +@param aStream Stream from which the object should be internalised. */
    1.48 +	{aStream>>iVal;}
    1.49 +inline TUint32 TPageRef::Value() const
    1.50 +/** Gets the page reference value.
    1.51 +
    1.52 +@return Page reference value */
    1.53 +	{return iVal;}
    1.54 +
    1.55 +// Class MPagePool
    1.56 +inline void MPagePool::Pop()
    1.57 +/** Do a pop from the cleanup stack. */
    1.58 +	{CleanupStack::Pop();}
    1.59 +
    1.60 +// Class CPageCache::TStats
    1.61 +#if defined(__PAGE_CACHE_STATS)
    1.62 +inline TInt CPageCache::TStats::Requests() const
    1.63 +	{return iRequests;}
    1.64 +inline TInt CPageCache::TStats::Hits() const
    1.65 +	{return iRequests-iMisses;}
    1.66 +inline TInt CPageCache::TStats::Misses() const
    1.67 +	{return iMisses;}
    1.68 +inline void CPageCache::TStats::Reset()
    1.69 +	{iRequests=0;iMisses=0;}
    1.70 +#endif
    1.71 +
    1.72 +// Class CPageCache
    1.73 +#if defined(__PAGE_CACHE_STATS)
    1.74 +inline CPageCache::TStats& CPageCache::Stats()
    1.75 +	{return iStats;}
    1.76 +inline const CPageCache::TStats& CPageCache::Stats() const
    1.77 +	{return iStats;}
    1.78 +#endif
    1.79 +
    1.80 +// Class TCachePagePool
    1.81 +inline void TCachePagePool::Set(CPageCache& aCache)
    1.82 +/** Sets the page cache for the pool.
    1.83 +
    1.84 +@param aCache The page cache for the pool. */
    1.85 +	{iCache=&aCache;}
    1.86 +inline TCachePagePool::TCachePagePool()
    1.87 +	: iCache(NULL)
    1.88 +	{}
    1.89 +inline TCachePagePool::TCachePagePool(CPageCache& aCache)
    1.90 +	: iCache(&aCache)
    1.91 +	{}
    1.92 +