|
1 /* |
|
2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: inline methods for DS host server. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __NSMLDSHOSTSESSION_INL__ |
|
20 #define __NSMLDSHOSTSESSION_INL__ |
|
21 |
|
22 // ------------------------------------------------------------------------------------------------ |
|
23 // CNSmlDSHostSession::TMemPtr::TMemPtr() |
|
24 // ------------------------------------------------------------------------------------------------ |
|
25 inline CNSmlDSHostSession::TMemPtr::TMemPtr() |
|
26 { |
|
27 #ifdef __HOST_SERVER_MTEST__ |
|
28 iChunkSize = KNSmlDSHostChunkMinSize; |
|
29 #endif |
|
30 } |
|
31 |
|
32 // ------------------------------------------------------------------------------------------------ |
|
33 // CNSmlDSHostSession::TMemPtr::Des |
|
34 // ------------------------------------------------------------------------------------------------ |
|
35 inline TPtr8 CNSmlDSHostSession::TMemPtr::Des() |
|
36 { |
|
37 return TPtr8( Ptr8(), Size() ); |
|
38 } |
|
39 |
|
40 // ------------------------------------------------------------------------------------------------ |
|
41 // CNSmlDSHostSession::TMemPtr::Mid |
|
42 // ------------------------------------------------------------------------------------------------ |
|
43 inline TPtr8 CNSmlDSHostSession::TMemPtr::Mid( TInt aPos, TInt aLength ) |
|
44 { |
|
45 TInt maxLength = Size() - aPos; |
|
46 return TPtr8( Ptr8() + aPos, Min<TInt>( aLength, maxLength ) ); |
|
47 } |
|
48 |
|
49 // ------------------------------------------------------------------------------------------------ |
|
50 // CNSmlDSHostSession::TMemPtr::CopyTo |
|
51 // ------------------------------------------------------------------------------------------------ |
|
52 inline void CNSmlDSHostSession::TMemPtr::CopyTo(TDes8& dest) const |
|
53 { |
|
54 dest.Copy( Ptr8(), dest.MaxLength() ); |
|
55 } |
|
56 |
|
57 // ------------------------------------------------------------------------------------------------ |
|
58 // CNSmlDSHostSession::TMemPtr::Size |
|
59 // ------------------------------------------------------------------------------------------------ |
|
60 inline TInt CNSmlDSHostSession::TMemPtr::Size() const |
|
61 { |
|
62 #ifdef __HOST_SERVER_MTEST__ |
|
63 return iChunkSize; |
|
64 #else |
|
65 return iChunk.Size(); |
|
66 #endif |
|
67 } |
|
68 |
|
69 // ------------------------------------------------------------------------------------------------ |
|
70 // CNSmlDSHostSession::TMemPtr::Adjust |
|
71 // ------------------------------------------------------------------------------------------------ |
|
72 inline TInt CNSmlDSHostSession::TMemPtr::Adjust( TInt aNewSize ) |
|
73 { |
|
74 #ifdef __HOST_SERVER_MTEST__ |
|
75 iChunkSize = aNewSize; |
|
76 #endif |
|
77 return iChunk.Adjust( aNewSize ); |
|
78 } |
|
79 |
|
80 // ------------------------------------------------------------------------------------------------ |
|
81 // CNSmlDSHostSession::TMemPtr::Ptr8 |
|
82 // ------------------------------------------------------------------------------------------------ |
|
83 inline TUint8* CNSmlDSHostSession::TMemPtr::Ptr8() |
|
84 { |
|
85 return iChunk.Base(); |
|
86 } |
|
87 |
|
88 // ------------------------------------------------------------------------------------------------ |
|
89 // CNSmlDSHostSession::TMemPtr::Ptr8 |
|
90 // ------------------------------------------------------------------------------------------------ |
|
91 inline const TUint8* CNSmlDSHostSession::TMemPtr::Ptr8() const |
|
92 { |
|
93 return iChunk.Base(); |
|
94 } |
|
95 |
|
96 // ------------------------------------------------------------------------------------------------ |
|
97 // CNSmlDSHostSession::TMemPtr::Ptr |
|
98 // ------------------------------------------------------------------------------------------------ |
|
99 inline TAny* CNSmlDSHostSession::TMemPtr::Ptr() const |
|
100 { |
|
101 return iChunk.Base(); |
|
102 } |
|
103 |
|
104 // ------------------------------------------------------------------------------------------------ |
|
105 // CNSmlDSHostSession::CNSmlServerDSHostItem::Uid |
|
106 // ------------------------------------------------------------------------------------------------ |
|
107 inline TSmlDbItemUid& CNSmlDSHostSession::CNSmlServerDSHostItem::Uid() |
|
108 { |
|
109 return iUid; |
|
110 } |
|
111 |
|
112 // ------------------------------------------------------------------------------------------------ |
|
113 // CNSmlDSHostSession::CNSmlServerDSHostItem::FieldChange |
|
114 // ------------------------------------------------------------------------------------------------ |
|
115 inline TBool& CNSmlDSHostSession::CNSmlServerDSHostItem::FieldChange() |
|
116 { |
|
117 return iFieldChange; |
|
118 } |
|
119 |
|
120 // ------------------------------------------------------------------------------------------------ |
|
121 // CNSmlDSHostSession::CNSmlServerDSHostItem::Size |
|
122 // ------------------------------------------------------------------------------------------------ |
|
123 inline TInt& CNSmlDSHostSession::CNSmlServerDSHostItem::Size() |
|
124 { |
|
125 return iSize; |
|
126 } |
|
127 |
|
128 // ------------------------------------------------------------------------------------------------ |
|
129 // CNSmlDSHostSession::CNSmlServerDSHostItem::ParentUid |
|
130 // ------------------------------------------------------------------------------------------------ |
|
131 inline TSmlDbItemUid& CNSmlDSHostSession::CNSmlServerDSHostItem::ParentUid() |
|
132 { |
|
133 return iParentUid; |
|
134 } |
|
135 |
|
136 // ------------------------------------------------------------------------------------------------ |
|
137 // CNSmlDSHostSession::CNSmlDSChangedItemsFetcher::ChangedItems |
|
138 // ------------------------------------------------------------------------------------------------ |
|
139 inline const RNSmlDbItemModificationSet* CNSmlDSChangedItemsFetcher::ChangedItems() const |
|
140 { |
|
141 return iChangedItems; |
|
142 } |
|
143 |
|
144 #endif |
|
145 |
|
146 // End of File |