os/persistentdata/persistentstorage/store/INC/U32PERM.INL
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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 TPermanentStoreHeader
    17 inline TUint8* TPermanentStoreHeader::Ptr()
    18 	{return REINTERPRET_CAST(TUint8*,&iBackup);}
    19 inline const TUint8* TPermanentStoreHeader::Ptr() const
    20 	{return REINTERPRET_CAST(const TUint8*,&iBackup);}
    21 inline TPermanentStoreHeader::TPermanentStoreHeader(TInt aToc)
    22 	{Set(aToc,0,aToc);}
    23 inline TPermanentStoreHeader::TPermanentStoreHeader(TInt aBackupToc,TInt aHandle,TInt aReference)
    24 	{
    25 	__ASSERT_DEBUG(aHandle!=0,User::Invariant());
    26 	Set(aBackupToc,aHandle,aReference);
    27 	}
    28 inline TBool TPermanentStoreHeader::IsDirty() const
    29 	{return iBackup&0x1;}
    30 inline void TPermanentStoreHeader::MarkDirty()
    31 	{iBackup|=0x1;}
    32 inline void TPermanentStoreHeader::SetBackupToc(TInt aBackupToc)
    33 	{
    34 	__ASSERT_DEBUG(aBackupToc>=0,User::Invariant());
    35 	iBackup=TUint32(aBackupToc)<<1;
    36 	}
    37 inline TInt TPermanentStoreHeader::BackupToc() const
    38 	{return iBackup>>1;}
    39 inline TInt TPermanentStoreHeader::Handle() const
    40 	{return iHandle;}
    41 inline TInt TPermanentStoreHeader::Reference() const
    42 	{return iRef;}
    43 
    44 // Class CPermanentStoreToc
    45 inline TInt CPermanentStoreToc::Extent() const
    46 	{return iExt;}
    47 inline TBool CPermanentStoreToc::IsVirtual() const
    48 	{return iPrimary<0;}
    49 inline TInt CPermanentStoreToc::Primary() const
    50 	{return iPrimary&KMaskStreamIdValue;}
    51 inline void CPermanentStoreToc::Changed()
    52 	{iPrimary|=KHandleInvalid;}
    53 inline TStreamPos CPermanentStoreToc::Base() const
    54 	{return iBase;}
    55 inline TStreamExchange& CPermanentStoreToc::Host() const
    56 	{
    57 	__ASSERT_DEBUG(iHost!=NULL,User::Invariant());
    58 	return *iHost;
    59 	}
    60 inline const CPermanentStoreToc::TEntry* CPermanentStoreToc::Entry(TInt aHandle) const
    61 	{return CONST_CAST(CPermanentStoreToc*,this)->Entry(aHandle);}
    62 inline TBool CPermanentStoreToc::HasDelta() const
    63 	{return iOff!=iTocOff;}
    64 
    65 // Class RPermanentStoreTocIter
    66 inline void RPermanentStoreTocIter::Close()
    67 	{Release();}
    68 
    69 // Class TPermanentStoreCache
    70 inline TPermanentStoreCache::TPermanentStoreCache()
    71 	{Invalidate();}
    72 
    73 // Class CPermanentStoreCoord
    74 inline TBool CPermanentStoreCoord::IsTrim() const
    75 	{return !(iState&EClip);}
    76 inline void CPermanentStoreCoord::Clipped()
    77 	{iState&=~EClip;}
    78 inline TStreamPos CPermanentStoreCoord::Base() const
    79 	{return iBase;}
    80 inline TStreamExchange& CPermanentStoreCoord::Host() const
    81 	{
    82 	__ASSERT_DEBUG(iHost!=NULL,User::Invariant());
    83 	return *iHost;
    84 	}
    85 inline TInt CPermanentStoreCoord::Toc() const
    86 	{return iToc;}
    87 inline CPermanentStoreToc& CPermanentStoreCoord::Table() const
    88 	{
    89 	__ASSERT_DEBUG(iTable!=NULL,User::Invariant());
    90 	return *iTable;
    91 	}
    92 inline TUint CPermanentStoreCoord::Generation() const
    93 	{return iGen;}
    94 inline void CPermanentStoreCoord::Inc()
    95 	{++iRefs;}
    96 inline void CPermanentStoreCoord::Dec()
    97 	{--iRefs;}
    98 inline TBool CPermanentStoreCoord::Accessed() const
    99 	{return iAccess;}
   100 
   101 // Class HPermanentStoreBuf
   102 inline HPermanentStoreBuf::HPermanentStoreBuf(CPermanentStoreCoord& aCoord)
   103 	: RFrame16Buf(aCoord.Base()),iCoord(&aCoord),iHandle(0)
   104 	{}
   105 inline CPermanentStoreCoord& HPermanentStoreBuf::Coord() const
   106 	{
   107 	__ASSERT_DEBUG(iCoord!=NULL,User::Invariant());
   108 	return *iCoord;
   109 	}
   110 
   111 // Class CPermanentStoreCollector
   112 inline CPermanentStoreCoord& CPermanentStoreCollector::Coord() const
   113 	{
   114 	__ASSERT_DEBUG(iCoord!=NULL,User::Invariant());
   115 	return *iCoord;
   116 	}
   117 inline TStreamExchange& CPermanentStoreCollector::Host() const
   118 	{
   119 	__ASSERT_DEBUG(iHost!=NULL,User::Invariant());
   120 	return *iHost;
   121 	}
   122 inline TBool CPermanentStoreCollector::Compacting() const
   123 	{return iReloc!=NULL;}
   124