|
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 inline TBtreeToken::TBtreeToken(TPageRef aFirst,TPageRef aRoot,TBtreeHeight aHeight) |
|
17 : iFirst(aFirst),iRoot(aRoot),iHeight(aHeight) |
|
18 { |
|
19 __ASSERT_DEBUG(aHeight<=KMaxBtreeHeight,User::Invariant()); |
|
20 } |
|
21 |
|
22 inline void TBtree::MarkIntact() |
|
23 {iStatus&=~EBroken;} |
|
24 inline TBool TBtree::IsRoot(const TBtreePath& aPath) const |
|
25 {return aPath.End()+1==iHeight;} |
|
26 inline const MBtreeNodeOrg* TBtree::NodeOrg(TBool aLeaf) const |
|
27 {if (aLeaf) return iLeafOrg; else return iIndexOrg;} |
|
28 |
|
29 inline const TBtreeInlineLeafOrg::SNode* TBtreeInlineLeafOrg::Node(const TAny* aNode) |
|
30 {return (const SNode*)aNode;} |
|
31 inline TBtreeInlineLeafOrg::SNode* TBtreeInlineLeafOrg::Node(TAny* aNode) |
|
32 {return (SNode*)aNode;} |
|
33 inline const TUint8* TBtreeInlineLeafOrg::Entry(const SNode* aNode,TInt anEntry) const |
|
34 {return &aNode->iEntries[anEntry*iEntrySize];} |
|
35 inline TUint8* TBtreeInlineLeafOrg::Entry(SNode* aNode,TInt anEntry) const |
|
36 {return &aNode->iEntries[anEntry*iEntrySize];} |
|
37 |
|
38 inline const TBtreeInlineIndexOrg::SNode* TBtreeInlineIndexOrg::Node(const TAny* aNode) |
|
39 {return (const SNode*)aNode;} |
|
40 inline TBtreeInlineIndexOrg::SNode* TBtreeInlineIndexOrg::Node(TAny* aNode) |
|
41 {return (SNode*)aNode;} |
|
42 inline const TBtreeInlineIndexOrg::SEntry* TBtreeInlineIndexOrg::Entry(const SNode* aNode,TInt anEntry) const |
|
43 {return (const SEntry*)&aNode->iEntries[anEntry*iEntrySize];} |
|
44 inline TBtreeInlineIndexOrg::SEntry* TBtreeInlineIndexOrg::Entry(SNode* aNode,TInt anEntry) const |
|
45 {return (SEntry*)&aNode->iEntries[anEntry*iEntrySize];} |
|
46 inline TInt TBtreeInlineIndexOrg::KeySize() const |
|
47 {return iEntrySize-sizeof(TPageRef);} |
|
48 |