|
1 /* |
|
2 * Copyright (c) 2009-2010 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: |
|
15 * Implementation of bearer priority array cache. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CMMBEARERPRIORITYCACHE_H_ |
|
21 #define CMMBEARERPRIORITYCACHE_H_ |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <metadatabase.h> |
|
25 |
|
26 class CCmmBearerPriority; |
|
27 class CCmmTransactionHandler; |
|
28 |
|
29 |
|
30 NONSHARABLE_CLASS( CCmmBearerPriorityCache ) : public CBase |
|
31 { |
|
32 public: |
|
33 /** |
|
34 * Two phased constuction. |
|
35 */ |
|
36 static CCmmBearerPriorityCache* NewL( |
|
37 CCmmTransactionHandler* aTrans, |
|
38 CommsDat::TMDBElementId aBearerPriorityTableId ); |
|
39 |
|
40 /** |
|
41 * Two phased constuction. |
|
42 */ |
|
43 static CCmmBearerPriorityCache* NewLC( |
|
44 CCmmTransactionHandler* aTrans, |
|
45 CommsDat::TMDBElementId aBearerPriorityTableId ); |
|
46 |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 ~CCmmBearerPriorityCache(); |
|
51 |
|
52 private: |
|
53 /** |
|
54 * Constructor. |
|
55 */ |
|
56 CCmmBearerPriorityCache( |
|
57 CCmmTransactionHandler* aTrans, |
|
58 CommsDat::TMDBElementId aBearerPriorityTableId ); |
|
59 |
|
60 /** |
|
61 * 2nd phase constructor. |
|
62 * Reads the bearer priorities from CommsDat and stores them to own array. |
|
63 */ |
|
64 void ConstructL(); |
|
65 |
|
66 public: |
|
67 /** |
|
68 * Updates the bearer priority array with the contents of aArray. |
|
69 */ |
|
70 void UpdateL( const RPointerArray<CCmmBearerPriority>& aArray ); |
|
71 |
|
72 /** |
|
73 * Copies the cache's contents to aArray. |
|
74 */ |
|
75 void CopyL( RPointerArray<CCmmBearerPriority>& aArray ) const; |
|
76 |
|
77 /** |
|
78 * Get the priority value for a service type from the bearer priority |
|
79 * cache. |
|
80 */ |
|
81 TUint GetPriority( const TDesC& aServiceType ) const; |
|
82 |
|
83 private: |
|
84 void ReadL(); |
|
85 |
|
86 private: |
|
87 // Database transaction handler. |
|
88 CCmmTransactionHandler* iTrans; // Not owned. |
|
89 |
|
90 // Cached contents of the bearer priority array. |
|
91 RPointerArray<CCmmBearerPriority> iArray; // Owns contents. |
|
92 |
|
93 // Global bearer type priorization table ID. |
|
94 CommsDat::TMDBElementId iBearerPriorityTableId; |
|
95 }; |
|
96 |
|
97 #endif // CMMBEARERPRIORITYCACHE_H_ |
|
98 |
|
99 // End of file |