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 the bearer priority array cache. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #include "cmmbearerpriority.h" |
|
21 |
|
22 |
|
23 // --------------------------------------------------------------------------- |
|
24 // Two phased construction. |
|
25 // --------------------------------------------------------------------------- |
|
26 // |
|
27 CCmmBearerPriority* CCmmBearerPriority::NewL( |
|
28 const TDesC& aServiceType, |
|
29 const TUint aPriority, |
|
30 const TUint aUiPriority ) |
|
31 { |
|
32 CCmmBearerPriority* self = CCmmBearerPriority::NewLC( aServiceType, aPriority, aUiPriority ); |
|
33 CleanupStack::Pop( self ); |
|
34 return self; |
|
35 } |
|
36 |
|
37 // --------------------------------------------------------------------------- |
|
38 // Two phased construction. |
|
39 // --------------------------------------------------------------------------- |
|
40 // |
|
41 CCmmBearerPriority* CCmmBearerPriority::NewLC( |
|
42 const TDesC& aServiceType, |
|
43 const TUint aPriority, |
|
44 const TUint aUiPriority ) |
|
45 { |
|
46 CCmmBearerPriority* self = new( ELeave ) CCmmBearerPriority( aPriority, aUiPriority ); |
|
47 CleanupStack::PushL( self ); |
|
48 self->ConstructL( aServiceType ); |
|
49 return self; |
|
50 } |
|
51 |
|
52 // --------------------------------------------------------------------------- |
|
53 // Constructor. Note: aServiceType is not copied here because constructor |
|
54 // cannot leave. |
|
55 // --------------------------------------------------------------------------- |
|
56 // |
|
57 CCmmBearerPriority::CCmmBearerPriority( |
|
58 const TUint aPriority, |
|
59 const TUint aUiPriority ) |
|
60 : |
|
61 iPriority( aPriority ), |
|
62 iUiPriority( aUiPriority ) |
|
63 { |
|
64 iServiceType = NULL; |
|
65 } |
|
66 |
|
67 // --------------------------------------------------------------------------- |
|
68 // 2nd phase constructor. |
|
69 // --------------------------------------------------------------------------- |
|
70 // |
|
71 void CCmmBearerPriority::ConstructL( const TDesC& aServiceType ) |
|
72 { |
|
73 iServiceType = aServiceType.AllocL(); |
|
74 } |
|
75 |
|
76 // --------------------------------------------------------------------------- |
|
77 // Get the service type. |
|
78 // --------------------------------------------------------------------------- |
|
79 // |
|
80 HBufC* CCmmBearerPriority::ServiceType() const |
|
81 { |
|
82 return iServiceType; |
|
83 } |
|
84 |
|
85 // --------------------------------------------------------------------------- |
|
86 // Get the priority. |
|
87 // --------------------------------------------------------------------------- |
|
88 // |
|
89 TUint CCmmBearerPriority::Priority() const |
|
90 { |
|
91 return iPriority; |
|
92 } |
|
93 |
|
94 // --------------------------------------------------------------------------- |
|
95 // Get the UI priority. |
|
96 // --------------------------------------------------------------------------- |
|
97 // |
|
98 TUint CCmmBearerPriority::UiPriority() const |
|
99 { |
|
100 return iUiPriority; |
|
101 } |
|
102 |
|
103 // --------------------------------------------------------------------------- |
|
104 // Destructor. |
|
105 // --------------------------------------------------------------------------- |
|
106 // |
|
107 CCmmBearerPriority::~CCmmBearerPriority() |
|
108 { |
|
109 delete iServiceType; |
|
110 } |
|
111 |
|
112 // End of file |
|