|
1 // Copyright (c) 2007-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 /** |
|
17 |
|
18 IsInRange() |
|
19 @param TMsvId : TMsvId of the entry |
|
20 @return TBool : ETrue if the TMsvId is in the range of the block, EFalse otherwise |
|
21 |
|
22 The function checks if the passed TMsvId falls in the range of the block. |
|
23 |
|
24 */ |
|
25 inline TBool CMsvCacheIndexTableEntry::IsInRange(TMsvId aId) const |
|
26 { |
|
27 if (aId >= iMinMsvId && aId <= iMaxMsvId) |
|
28 { |
|
29 return(ETrue); |
|
30 } |
|
31 else |
|
32 { |
|
33 return(EFalse); |
|
34 } |
|
35 } |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 /** |
|
43 * IsDirty() |
|
44 * @param None |
|
45 * @return TBool : status of the dirty flag |
|
46 * |
|
47 * The function return ETrue if the dirty flag is set, EFalse if otherwise. |
|
48 */ |
|
49 inline TBool CMsvCacheIndexTableEntry::IsDirty() const |
|
50 { |
|
51 if(iFlags & EMsvCacheIndexTableSetDirtyFlag) |
|
52 { |
|
53 return(ETrue); |
|
54 } |
|
55 else |
|
56 { |
|
57 return (EFalse); |
|
58 } |
|
59 } |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 /** |
|
67 * SetDirty() |
|
68 * @param TBool: set or reset |
|
69 * @return None. |
|
70 * |
|
71 * The function sets or resets the dirty flag depending on the aFlag variable |
|
72 * passed. |
|
73 */ |
|
74 inline void CMsvCacheIndexTableEntry::SetDirty() |
|
75 { |
|
76 iFlags |= EMsvCacheIndexTableSetDirtyFlag; |
|
77 } |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 /** |
|
84 * ClearDirty() |
|
85 * @param TBool: set or reset |
|
86 * @return None. |
|
87 * |
|
88 * The function sets or resets the dirty flag depending on the aFlag variable |
|
89 * passed. |
|
90 */ |
|
91 inline void CMsvCacheIndexTableEntry::ClearDirty() |
|
92 { |
|
93 iFlags &= EMsvCacheIndexTableClearDirtyFlag; |
|
94 } |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 /** |
|
100 * SetMinMsvIdRange() |
|
101 * @param TMsvId : the TMsvId representing the lower part of the range |
|
102 * @return None. |
|
103 * |
|
104 * The function sets the iMinMsvId to the TMsvId passed. |
|
105 */ |
|
106 inline void CMsvCacheIndexTableEntry::SetMinMsvIdRange(TMsvId aId) |
|
107 { |
|
108 iMinMsvId = aId; |
|
109 } |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 /** |
|
117 * SetMaxMsvIdRange() |
|
118 * @param TMsvId : the TMsvId representing the upper part of the range |
|
119 * @return None. |
|
120 * |
|
121 * The function sets the iMaxMsvId to the TMsvId passed. |
|
122 */ |
|
123 inline void CMsvCacheIndexTableEntry::SetMaxMsvIdRange(TMsvId aId) |
|
124 { |
|
125 iMaxMsvId = aId; |
|
126 } |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 /** |
|
134 * GetMinMsvIdRange() |
|
135 * @param None. |
|
136 * @return TMsvId : the lower part of the block's range |
|
137 * |
|
138 * The function returns the iMinMsvId to the TMsvId passed. |
|
139 */ |
|
140 inline TMsvId CMsvCacheIndexTableEntry::GetMinMsvIdRange() const |
|
141 { |
|
142 return(iMinMsvId); |
|
143 } |
|
144 |
|
145 |
|
146 |
|
147 |
|
148 |
|
149 |
|
150 /** |
|
151 * GetMaxMsvIdRange() |
|
152 * @param None. |
|
153 * @return TMsvId : the upper part of the block's range |
|
154 * |
|
155 * The function returns the iMaxMsvId to the TMsvId passed. |
|
156 */ |
|
157 inline TMsvId CMsvCacheIndexTableEntry::GetMaxMsvIdRange() const |
|
158 { |
|
159 return(iMaxMsvId); |
|
160 } |
|
161 |
|
162 |
|
163 |
|
164 |
|
165 |
|
166 |
|
167 /** |
|
168 * Size() |
|
169 * @param None. |
|
170 * @return TInt : the number of entries currently in the block |
|
171 * |
|
172 * The function returns the number of entries currently present in the block. |
|
173 */ |
|
174 inline TInt CMsvCacheIndexTableEntry::Size() const |
|
175 { |
|
176 if(iBlockPtr == NULL) |
|
177 { |
|
178 return 0; |
|
179 } |
|
180 else |
|
181 { |
|
182 return(iBlockPtr->Count()); |
|
183 } |
|
184 } |
|
185 |
|
186 |
|
187 |
|
188 |
|
189 |
|
190 |
|
191 /** |
|
192 * ClearFlags() |
|
193 * @param None. |
|
194 * @return None. |
|
195 * |
|
196 * The function clears all the flags. |
|
197 */ |
|
198 inline void CMsvCacheIndexTableEntry::ClearFlags() |
|
199 { |
|
200 iFlags &= 0X0000; |
|
201 } |
|
202 |
|
203 |
|
204 |
|
205 |
|
206 |
|
207 |
|
208 /** |
|
209 * SetGrandChildPresent() |
|
210 * @param TBool : set or reset |
|
211 * @return None. |
|
212 * |
|
213 * The function sets or resets the flag depending on whether grandchildren entries are present in the block. |
|
214 */ |
|
215 inline void CMsvCacheIndexTableEntry::SetGrandChildPresent() |
|
216 { |
|
217 iFlags |= EMsvCacheIndexTableEntrySetGrandChildPresent; |
|
218 } |
|
219 |
|
220 |
|
221 |
|
222 |
|
223 |
|
224 /** |
|
225 * SetGrandChildPresent() |
|
226 * @param TBool : set or reset |
|
227 * @return None. |
|
228 * |
|
229 * The function sets or resets the flag depending on whether grandchildren entries are present in the block. |
|
230 */ |
|
231 inline void CMsvCacheIndexTableEntry::ClearGrandChildPresent() |
|
232 { |
|
233 iFlags &= EMsvCacheIndexTableEntryClearGrandChildPresent; |
|
234 } |
|
235 |
|
236 |
|
237 |
|
238 |
|
239 |
|
240 /** |
|
241 * IsGrandChildPresent() |
|
242 * @param None. |
|
243 * @return TBool : value of the EMsvCacheIndexTableEntrySetGrandChildPresent flag |
|
244 * |
|
245 * The function returns ETrue if there are grandchildren present in the block, EFalse if otherwise. |
|
246 */ |
|
247 inline TBool CMsvCacheIndexTableEntry::IsGrandChildPresent() const |
|
248 { |
|
249 if(iFlags & EMsvCacheIndexTableEntrySetGrandChildPresent) |
|
250 { |
|
251 return ETrue; |
|
252 } |
|
253 else |
|
254 { |
|
255 return EFalse; |
|
256 } |
|
257 } |
|
258 |
|
259 |
|
260 |
|
261 |
|
262 /** |
|
263 * BlockPtr() |
|
264 * @param None. |
|
265 * @return RPointerArray<CMsvCacheEntry>* : handle to the block. |
|
266 * |
|
267 * The function returns a handle to the block. |
|
268 */ |
|
269 inline RPointerArray<CMsvCacheEntry>* CMsvCacheIndexTableEntry::BlockPtr() |
|
270 { |
|
271 return iBlockPtr; |
|
272 } |
|
273 |
|
274 |
|
275 |
|
276 |
|
277 /** |
|
278 * AccessTime() |
|
279 * @param None. |
|
280 * @return TTime : the last accessed time of the block. |
|
281 * |
|
282 * The function the last accessed time of the block. |
|
283 */ |
|
284 inline const TTime CMsvCacheIndexTableEntry::AccessTime() const |
|
285 { |
|
286 return iTimeStamp; |
|
287 } |
|
288 |
|
289 |
|
290 |
|
291 /** |
|
292 * SetAccessTime() |
|
293 * @param TTime : New time. |
|
294 * @return void. |
|
295 * |
|
296 * The function set the new timestamp for the block. |
|
297 */ |
|
298 inline void CMsvCacheIndexTableEntry::SetAccessTime(TTime aNewTime) |
|
299 { |
|
300 iTimeStamp = aNewTime; |
|
301 } |
|
302 |
|
303 |
|
304 |