|
1 /* |
|
2 * Copyright (c) 2007 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: Fast counters for local database |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #include <epos_cposlmlocaldbaccess.h> |
|
21 #include <epos_poslmlandmarkhandler.h> |
|
22 #include <epos_poslmcategoryhandler.h> |
|
23 |
|
24 #include "epos_cposlmlocaldbfastcounters.h" |
|
25 |
|
26 // ============================ MEMBER FUNCTIONS =============================== |
|
27 |
|
28 // ----------------------------------------------------------------------------- |
|
29 // ----------------------------------------------------------------------------- |
|
30 // |
|
31 CPosLmLocalDbFastCounters::CPosLmLocalDbFastCounters( CPosLmLocalDbAccess& aDbAccess ) |
|
32 : iDbAccess( aDbAccess ) |
|
33 { |
|
34 } |
|
35 |
|
36 // ----------------------------------------------------------------------------- |
|
37 // ----------------------------------------------------------------------------- |
|
38 // |
|
39 CPosLmLocalDbFastCounters::~CPosLmLocalDbFastCounters() |
|
40 { |
|
41 } |
|
42 |
|
43 // ----------------------------------------------------------------------------- |
|
44 // ----------------------------------------------------------------------------- |
|
45 // |
|
46 CPosLmLocalDbFastCounters* CPosLmLocalDbFastCounters::NewL( CPosLmLocalDbAccess& aDbAccess ) |
|
47 { |
|
48 return new (ELeave) CPosLmLocalDbFastCounters( aDbAccess ); |
|
49 } |
|
50 |
|
51 // ----------------------------------------------------------------------------- |
|
52 // From MPosDatabaseFastCounters |
|
53 // ----------------------------------------------------------------------------- |
|
54 // |
|
55 TInt CPosLmLocalDbFastCounters::TotalLandmarksCount() |
|
56 { |
|
57 TInt err( KErrNone ); |
|
58 TUint count( 0 ); |
|
59 TRAP( err, count = PosLmLandmarkHandler::TotalLandmarkCountL( iDbAccess ); ); |
|
60 |
|
61 return err ? err : count; |
|
62 } |
|
63 |
|
64 // ----------------------------------------------------------------------------- |
|
65 // From MPosDatabaseFastCounters |
|
66 // ----------------------------------------------------------------------------- |
|
67 // |
|
68 TInt CPosLmLocalDbFastCounters::TotalCategoriesCount() |
|
69 { |
|
70 TInt err( KErrNone ); |
|
71 TUint count( 0 ); |
|
72 TRAP( err, count = PosLmCategoryHandler::TotalCategoryCountL( iDbAccess ); ); |
|
73 |
|
74 return err ? err : count; |
|
75 } |
|
76 |
|
77 // ----------------------------------------------------------------------------- |
|
78 // From MPosDatabaseFastCounters |
|
79 // ----------------------------------------------------------------------------- |
|
80 // |
|
81 TInt CPosLmLocalDbFastCounters::UncategorizedLandmarksCount() |
|
82 { |
|
83 return KErrNotSupported; |
|
84 } |
|
85 |
|
86 // ----------------------------------------------------------------------------- |
|
87 // From MPosDatabaseFastCounters |
|
88 // ----------------------------------------------------------------------------- |
|
89 // |
|
90 TInt CPosLmLocalDbFastCounters::UnreferencedCategoriesCount() |
|
91 { |
|
92 return KErrNotSupported; |
|
93 } |
|
94 |
|
95 // ----------------------------------------------------------------------------- |
|
96 // From MPosDatabaseFastCounters |
|
97 // ----------------------------------------------------------------------------- |
|
98 // |
|
99 TInt CPosLmLocalDbFastCounters::CategorizedLandmarksCount() |
|
100 { |
|
101 return KErrNotSupported; |
|
102 } |
|
103 |
|
104 // ----------------------------------------------------------------------------- |
|
105 // From MPosDatabaseFastCounters |
|
106 // ----------------------------------------------------------------------------- |
|
107 // |
|
108 TInt CPosLmLocalDbFastCounters::ReferencedCategoriesCount() |
|
109 { |
|
110 return KErrNotSupported; |
|
111 } |