|
1 /* |
|
2 * Copyright (c) 2002-2006 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 the License "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: Implementation of ScanList inline methods. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // --------------------------------------------------------------------------- |
|
20 // |
|
21 // --------------------------------------------------------------------------- |
|
22 // |
|
23 inline u32_t ScanList::Count() const |
|
24 { |
|
25 return count_m; |
|
26 } |
|
27 |
|
28 // --------------------------------------------------------------------------- |
|
29 // |
|
30 // --------------------------------------------------------------------------- |
|
31 // |
|
32 inline u32_t ScanList::Size() const |
|
33 { |
|
34 return size_m; |
|
35 } |
|
36 |
|
37 // --------------------------------------------------------------------------- |
|
38 // |
|
39 // --------------------------------------------------------------------------- |
|
40 // |
|
41 inline u32_t ScanList::MaxSize() const |
|
42 { |
|
43 return max_size_m; |
|
44 } |
|
45 |
|
46 // --------------------------------------------------------------------------- |
|
47 // |
|
48 // --------------------------------------------------------------------------- |
|
49 // |
|
50 inline u8_t* ScanList::Data() const |
|
51 { |
|
52 return data_m; |
|
53 } |
|
54 |
|
55 // --------------------------------------------------------------------------- |
|
56 // |
|
57 // --------------------------------------------------------------------------- |
|
58 // |
|
59 inline void ScanList::Update( |
|
60 u32_t count, |
|
61 u32_t size ) |
|
62 { |
|
63 count_m = count; |
|
64 size_m = size; |
|
65 } |
|
66 |
|
67 // --------------------------------------------------------------------------- |
|
68 // |
|
69 // --------------------------------------------------------------------------- |
|
70 // |
|
71 inline void ScanList::ClearAll() |
|
72 { |
|
73 delete data_m; |
|
74 data_m = NULL; |
|
75 count_m = 0; |
|
76 size_m = 0; |
|
77 current_max_size_m = 0; |
|
78 } |
|
79 |
|
80 // --------------------------------------------------------------------------- |
|
81 // |
|
82 // --------------------------------------------------------------------------- |
|
83 // |
|
84 inline u32_t ScanList::AddPadding( |
|
85 u32_t data_length ) |
|
86 { |
|
87 /** @note size & 0x3 has the same result as size % 4 */ |
|
88 return ( data_length & 0x3 ) ? data_length + ( 4 - data_length & 0x3 ) : data_length; |
|
89 } |
|
90 |
|
91 // --------------------------------------------------------------------------- |
|
92 // |
|
93 // --------------------------------------------------------------------------- |
|
94 // |
|
95 inline u32_t ScanList::Compress() |
|
96 { |
|
97 return SetCurrentMaxSize( size_m ); |
|
98 } |