os/persistentdata/persistentstorage/store/INC/U32PERM.INL
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/persistentstorage/store/INC/U32PERM.INL	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,124 @@
     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 TPermanentStoreHeader
    1.20 +inline TUint8* TPermanentStoreHeader::Ptr()
    1.21 +	{return REINTERPRET_CAST(TUint8*,&iBackup);}
    1.22 +inline const TUint8* TPermanentStoreHeader::Ptr() const
    1.23 +	{return REINTERPRET_CAST(const TUint8*,&iBackup);}
    1.24 +inline TPermanentStoreHeader::TPermanentStoreHeader(TInt aToc)
    1.25 +	{Set(aToc,0,aToc);}
    1.26 +inline TPermanentStoreHeader::TPermanentStoreHeader(TInt aBackupToc,TInt aHandle,TInt aReference)
    1.27 +	{
    1.28 +	__ASSERT_DEBUG(aHandle!=0,User::Invariant());
    1.29 +	Set(aBackupToc,aHandle,aReference);
    1.30 +	}
    1.31 +inline TBool TPermanentStoreHeader::IsDirty() const
    1.32 +	{return iBackup&0x1;}
    1.33 +inline void TPermanentStoreHeader::MarkDirty()
    1.34 +	{iBackup|=0x1;}
    1.35 +inline void TPermanentStoreHeader::SetBackupToc(TInt aBackupToc)
    1.36 +	{
    1.37 +	__ASSERT_DEBUG(aBackupToc>=0,User::Invariant());
    1.38 +	iBackup=TUint32(aBackupToc)<<1;
    1.39 +	}
    1.40 +inline TInt TPermanentStoreHeader::BackupToc() const
    1.41 +	{return iBackup>>1;}
    1.42 +inline TInt TPermanentStoreHeader::Handle() const
    1.43 +	{return iHandle;}
    1.44 +inline TInt TPermanentStoreHeader::Reference() const
    1.45 +	{return iRef;}
    1.46 +
    1.47 +// Class CPermanentStoreToc
    1.48 +inline TInt CPermanentStoreToc::Extent() const
    1.49 +	{return iExt;}
    1.50 +inline TBool CPermanentStoreToc::IsVirtual() const
    1.51 +	{return iPrimary<0;}
    1.52 +inline TInt CPermanentStoreToc::Primary() const
    1.53 +	{return iPrimary&KMaskStreamIdValue;}
    1.54 +inline void CPermanentStoreToc::Changed()
    1.55 +	{iPrimary|=KHandleInvalid;}
    1.56 +inline TStreamPos CPermanentStoreToc::Base() const
    1.57 +	{return iBase;}
    1.58 +inline TStreamExchange& CPermanentStoreToc::Host() const
    1.59 +	{
    1.60 +	__ASSERT_DEBUG(iHost!=NULL,User::Invariant());
    1.61 +	return *iHost;
    1.62 +	}
    1.63 +inline const CPermanentStoreToc::TEntry* CPermanentStoreToc::Entry(TInt aHandle) const
    1.64 +	{return CONST_CAST(CPermanentStoreToc*,this)->Entry(aHandle);}
    1.65 +inline TBool CPermanentStoreToc::HasDelta() const
    1.66 +	{return iOff!=iTocOff;}
    1.67 +
    1.68 +// Class RPermanentStoreTocIter
    1.69 +inline void RPermanentStoreTocIter::Close()
    1.70 +	{Release();}
    1.71 +
    1.72 +// Class TPermanentStoreCache
    1.73 +inline TPermanentStoreCache::TPermanentStoreCache()
    1.74 +	{Invalidate();}
    1.75 +
    1.76 +// Class CPermanentStoreCoord
    1.77 +inline TBool CPermanentStoreCoord::IsTrim() const
    1.78 +	{return !(iState&EClip);}
    1.79 +inline void CPermanentStoreCoord::Clipped()
    1.80 +	{iState&=~EClip;}
    1.81 +inline TStreamPos CPermanentStoreCoord::Base() const
    1.82 +	{return iBase;}
    1.83 +inline TStreamExchange& CPermanentStoreCoord::Host() const
    1.84 +	{
    1.85 +	__ASSERT_DEBUG(iHost!=NULL,User::Invariant());
    1.86 +	return *iHost;
    1.87 +	}
    1.88 +inline TInt CPermanentStoreCoord::Toc() const
    1.89 +	{return iToc;}
    1.90 +inline CPermanentStoreToc& CPermanentStoreCoord::Table() const
    1.91 +	{
    1.92 +	__ASSERT_DEBUG(iTable!=NULL,User::Invariant());
    1.93 +	return *iTable;
    1.94 +	}
    1.95 +inline TUint CPermanentStoreCoord::Generation() const
    1.96 +	{return iGen;}
    1.97 +inline void CPermanentStoreCoord::Inc()
    1.98 +	{++iRefs;}
    1.99 +inline void CPermanentStoreCoord::Dec()
   1.100 +	{--iRefs;}
   1.101 +inline TBool CPermanentStoreCoord::Accessed() const
   1.102 +	{return iAccess;}
   1.103 +
   1.104 +// Class HPermanentStoreBuf
   1.105 +inline HPermanentStoreBuf::HPermanentStoreBuf(CPermanentStoreCoord& aCoord)
   1.106 +	: RFrame16Buf(aCoord.Base()),iCoord(&aCoord),iHandle(0)
   1.107 +	{}
   1.108 +inline CPermanentStoreCoord& HPermanentStoreBuf::Coord() const
   1.109 +	{
   1.110 +	__ASSERT_DEBUG(iCoord!=NULL,User::Invariant());
   1.111 +	return *iCoord;
   1.112 +	}
   1.113 +
   1.114 +// Class CPermanentStoreCollector
   1.115 +inline CPermanentStoreCoord& CPermanentStoreCollector::Coord() const
   1.116 +	{
   1.117 +	__ASSERT_DEBUG(iCoord!=NULL,User::Invariant());
   1.118 +	return *iCoord;
   1.119 +	}
   1.120 +inline TStreamExchange& CPermanentStoreCollector::Host() const
   1.121 +	{
   1.122 +	__ASSERT_DEBUG(iHost!=NULL,User::Invariant());
   1.123 +	return *iHost;
   1.124 +	}
   1.125 +inline TBool CPermanentStoreCollector::Compacting() const
   1.126 +	{return iReloc!=NULL;}
   1.127 +