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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #include "D32Assert.h"
18 // Class CDbStoreDatabase
19 inline CStreamStore& CDbStoreDatabase::Store()
24 inline MDbStreamFilter* CDbStoreDatabase::Filter()
29 // Class TDbStoreIndexStats
30 inline TDbStoreIndexStats::TDbStoreIndexStats() :
36 inline TBool TDbStoreIndexStats::IsValid() const
38 return iRefresh>=ERefresh;
41 // Class CDbStoreIndexDef
42 inline void CDbStoreIndexDef::SetTokenId(TStreamId anId)
47 inline TStreamId CDbStoreIndexDef::TokenId() const
53 inline TInt TRecordSize::Clustering() const
58 inline TInt TRecordSize::InlineLimit() const
63 inline TInt TRecordSize::FixedFieldSize(TDbColType aType)
65 __ASSERT(aType>EDbColBit&&aType<EDbColText8);
66 return FieldSizes[aType];
70 inline void CDbStoreDef::SetTokenId(TStreamId anId)
75 inline TStreamId CDbStoreDef::TokenId() const
80 inline TInt CDbStoreDef::Clustering() const
82 return iInfo.Clustering();
85 inline TInt CDbStoreDef::InlineLimit() const
87 return iInfo.InlineLimit();
91 inline TClusterId ClusterId(TDbRecordId aRecordId)
93 return aRecordId.Value()>>4;
96 inline TInt RecordIndex(TDbRecordId aRecordId)
98 return aRecordId.Value()&0xfu;
101 inline TDbRecordId RecordId(TClusterId aId,TInt aIndex)
103 __ASSERT(TUint(aIndex)<16u);
104 return (aId<<4)+aIndex;
107 inline TClusterId ClusterId(TStreamId aStreamId)
109 return aStreamId.Value();
113 inline RClusterMap::RClusterMap()
115 __ASSERT(iMap==0 && iAlloc==0);
118 inline void RClusterMap::Close()
123 inline TClusterId RClusterMap::LastBound() const
128 inline void RClusterMap::Complete(TClusterId aLastCluster)
130 if (aLastCluster==iLastBound)
136 inline TBool RClusterMap::IsComplete() const
141 inline void RClusterMap::BindL(TClusterId aPrevious,TClusterId aCluster)
143 if (aPrevious==iLastBound)
149 // Class TClusterLinkCache
150 inline void TClusterLinkCache::Invalidate()
155 void TClusterLinkCache::Reset(TClusterId aBaseId)
157 *(iEnd=iMap)=aBaseId;
160 inline void TClusterLinkCache::Bind(TClusterId aPrevious,TClusterId aCluster,RClusterMap& aMap)
162 if (iEnd!=NULL && *iEnd==aPrevious)
169 inline CCluster::CCluster(CDbStoreDatabase& aDatabase) :
174 inline TBool CCluster::IsFull() const
176 return iMap[KMaxClustering]-iMap[0]>=KClusterLimit;
179 inline TClusterId CCluster::Id() const
184 inline const TClusterDes& CCluster::Des() const
189 // Class CClusterCache
190 inline CDbStoreDatabase& CClusterCache::Database()
195 inline CStreamStore& CClusterCache::Store()
197 return Database().Store();
200 // Class CDbStoreRecords
201 inline TClusterId CDbStoreRecords::Head() const
206 inline TInt CDbStoreRecords::Count() const
208 return iToken.iCount;
211 // Class CDbStoreTable
212 inline const CDbStoreDef& CDbStoreTable::Def() const
214 return STATIC_CAST(const CDbStoreDef&,CDbTable::Def());
217 inline CDbStoreDatabase& CDbStoreTable::Database()
219 return STATIC_CAST(CDbStoreDatabase&,CDbTable::Database());
222 inline CDbStoreRecords& CDbStoreTable::StoreRecordsL()
224 return STATIC_CAST(CDbStoreRecords&,CDbTable::RecordsL());
228 // Class CDbStoreCompression
229 inline void CDbStoreCompression::Inflate()
231 __ASSERT(iState==EDecoding);