persistentstorage/store/INC/S32PAGE.INL
changeset 0 08ec8eefde2f
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     1 // Copyright (c) 1998-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 // Class TPageRef
       
    17 inline TPageRef::TPageRef(TUint32 aValue)
       
    18 	: iVal(aValue)
       
    19 /** Constructor that initialises the object to a page reference value.
       
    20 
       
    21 @param aValue Page reference value */
       
    22 	{}
       
    23 inline TBool TPageRef::operator==(TPageRef aRef) const
       
    24 /** Equality operator.
       
    25 
       
    26 @param aRef Page reference against which to compare
       
    27 @return True if aRef refers to the same page as the object, otherwise false. */
       
    28 	{return iVal==aRef.iVal;}
       
    29 inline TBool TPageRef::operator!=(TPageRef aRef) const
       
    30 /** Inequality operator.
       
    31 
       
    32 @param aRef Page reference against which to compare
       
    33 @return True if aRef does not refer to the same page as the object, otherwise 
       
    34 false. */
       
    35 	{return iVal!=aRef.iVal;}
       
    36 inline void TPageRef::ExternalizeL(RWriteStream& aStream) const
       
    37 /** Externalises a TPageRef object to a write stream.
       
    38 
       
    39 @param aStream Stream to which the object should be externalised. */
       
    40 	{aStream<<iVal;}
       
    41 inline void TPageRef::InternalizeL(RReadStream& aStream)
       
    42 /** Internalises a TPageRef object from a read stream.
       
    43 
       
    44 @param aStream Stream from which the object should be internalised. */
       
    45 	{aStream>>iVal;}
       
    46 inline TUint32 TPageRef::Value() const
       
    47 /** Gets the page reference value.
       
    48 
       
    49 @return Page reference value */
       
    50 	{return iVal;}
       
    51 
       
    52 // Class MPagePool
       
    53 inline void MPagePool::Pop()
       
    54 /** Do a pop from the cleanup stack. */
       
    55 	{CleanupStack::Pop();}
       
    56 
       
    57 // Class CPageCache::TStats
       
    58 #if defined(__PAGE_CACHE_STATS)
       
    59 inline TInt CPageCache::TStats::Requests() const
       
    60 	{return iRequests;}
       
    61 inline TInt CPageCache::TStats::Hits() const
       
    62 	{return iRequests-iMisses;}
       
    63 inline TInt CPageCache::TStats::Misses() const
       
    64 	{return iMisses;}
       
    65 inline void CPageCache::TStats::Reset()
       
    66 	{iRequests=0;iMisses=0;}
       
    67 #endif
       
    68 
       
    69 // Class CPageCache
       
    70 #if defined(__PAGE_CACHE_STATS)
       
    71 inline CPageCache::TStats& CPageCache::Stats()
       
    72 	{return iStats;}
       
    73 inline const CPageCache::TStats& CPageCache::Stats() const
       
    74 	{return iStats;}
       
    75 #endif
       
    76 
       
    77 // Class TCachePagePool
       
    78 inline void TCachePagePool::Set(CPageCache& aCache)
       
    79 /** Sets the page cache for the pool.
       
    80 
       
    81 @param aCache The page cache for the pool. */
       
    82 	{iCache=&aCache;}
       
    83 inline TCachePagePool::TCachePagePool()
       
    84 	: iCache(NULL)
       
    85 	{}
       
    86 inline TCachePagePool::TCachePagePool(CPageCache& aCache)
       
    87 	: iCache(&aCache)
       
    88 	{}
       
    89