|
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: Mapping that simply contains a unique log id and a |
|
15 presentity id. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include "clogsextlogidpresidmapping.h" |
|
23 #include "logwrap.h" |
|
24 #include "simpledebug.h" |
|
25 |
|
26 // --------------------------------------------------------------------------- |
|
27 // NewL |
|
28 // --------------------------------------------------------------------------- |
|
29 // |
|
30 CLogsExtLogIdPresIdMapping* CLogsExtLogIdPresIdMapping::NewL( |
|
31 const TLogId aLogId, |
|
32 const TDesC& aPresentityId ) |
|
33 { |
|
34 CLogsExtLogIdPresIdMapping* self = |
|
35 CLogsExtLogIdPresIdMapping::NewLC( aLogId, aPresentityId ); |
|
36 CleanupStack::Pop( self ); |
|
37 return self; |
|
38 } |
|
39 |
|
40 |
|
41 // --------------------------------------------------------------------------- |
|
42 // NewLC |
|
43 // --------------------------------------------------------------------------- |
|
44 // |
|
45 CLogsExtLogIdPresIdMapping* CLogsExtLogIdPresIdMapping::NewLC( |
|
46 const TLogId aLogId, |
|
47 const TDesC& aPresentityId ) |
|
48 { |
|
49 CLogsExtLogIdPresIdMapping* self = |
|
50 new( ELeave ) CLogsExtLogIdPresIdMapping( aLogId ); |
|
51 CleanupStack::PushL( self ); |
|
52 self->ConstructL( aPresentityId ); |
|
53 return self; |
|
54 } |
|
55 |
|
56 // --------------------------------------------------------------------------- |
|
57 // Symbian Second Phase Constructor. |
|
58 // --------------------------------------------------------------------------- |
|
59 // |
|
60 void CLogsExtLogIdPresIdMapping::ConstructL( const TDesC& aPresentityId ) |
|
61 { |
|
62 _LOG("CLogsExtLogIdPresIdMapping::ConstructL: begin") |
|
63 |
|
64 iPresentityId = aPresentityId.AllocL(); |
|
65 |
|
66 _LOG("CLogsExtLogIdPresIdMapping::ConstructL: end") |
|
67 } |
|
68 |
|
69 // --------------------------------------------------------------------------- |
|
70 // Destructor |
|
71 // --------------------------------------------------------------------------- |
|
72 // |
|
73 CLogsExtLogIdPresIdMapping::~CLogsExtLogIdPresIdMapping() |
|
74 { |
|
75 _LOG("CLogsExtLogIdPresIdMapping::~CLogsExtLogIdPresIdMapping: begin") |
|
76 delete iPresentityId; |
|
77 _LOG("CLogsExtLogIdPresIdMapping::~CLogsExtLogIdPresIdMapping: end") |
|
78 } |
|
79 |
|
80 |
|
81 // --------------------------------------------------------------------------- |
|
82 // Constructor |
|
83 // --------------------------------------------------------------------------- |
|
84 // |
|
85 CLogsExtLogIdPresIdMapping::CLogsExtLogIdPresIdMapping( TLogId aLogId ): |
|
86 iLogId( aLogId ) |
|
87 { |
|
88 _LOG("CLogsExtLogIdPresIdMapping::CLogsExtLogIdPresIdMapping()" ) |
|
89 } |
|
90 |
|
91 |
|
92 // --------------------------------------------------------------------------- |
|
93 // Getter function for the log id of this mapping. |
|
94 // --------------------------------------------------------------------------- |
|
95 // |
|
96 TLogId CLogsExtLogIdPresIdMapping::LogId() |
|
97 { |
|
98 _LOGP("CLogsExtLogIdPresIdMapping::LogId(): logId=%d",iLogId) |
|
99 return iLogId; |
|
100 } |
|
101 |
|
102 |
|
103 // --------------------------------------------------------------------------- |
|
104 // Getter function for the presentity id of this mapping. |
|
105 // --------------------------------------------------------------------------- |
|
106 // |
|
107 const TDesC* CLogsExtLogIdPresIdMapping::PresentityId() |
|
108 { |
|
109 if ( iPresentityId ) |
|
110 { |
|
111 _LOGDES( *iPresentityId ) |
|
112 } |
|
113 return iPresentityId; |
|
114 } |
|
115 |
|
116 |
|
117 |