|
1 /* |
|
2 * Copyright (c) 2009 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 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "mmmtpdp_variant.hrh" |
|
20 |
|
21 #ifndef CMMMTPDPPERFLOG_H |
|
22 #define CMMMTPDPPERFLOG_H |
|
23 |
|
24 #if defined(_DEBUG) || defined(MMMTPDP_PERFLOG) |
|
25 #define PERFLOGSTART(AAA) iPerfLog->Start(AAA); |
|
26 #define PERFLOGSTOP(AAA) iPerfLog->Stop(AAA); |
|
27 #else |
|
28 #define PERFLOGSTART(AAA) |
|
29 #define PERFLOGSTOP(AAA) |
|
30 #endif // defined(_DEBUG) || defined(MMMTPDP_PERFLOG) |
|
31 |
|
32 #if defined(_DEBUG) || defined(MMMTPDP_PERFLOG) |
|
33 #include <e32base.h> |
|
34 #include <badesca.h> |
|
35 |
|
36 // forward declaration |
|
37 class CMmMtpDpPerfLog; |
|
38 |
|
39 class TMmMtpDpOverflowHandler : public TDesOverflow |
|
40 { |
|
41 public: |
|
42 |
|
43 inline void SetOwner( CMmMtpDpPerfLog* aOwner ); |
|
44 inline void Overflow( TDes& aDes ); |
|
45 |
|
46 private: |
|
47 |
|
48 CMmMtpDpPerfLog* iOwner; |
|
49 }; |
|
50 |
|
51 class CMmMtpDpPerfLog : public CBase |
|
52 { |
|
53 public: |
|
54 |
|
55 inline static CMmMtpDpPerfLog* NewL( const TDesC& aTitle ); |
|
56 inline ~CMmMtpDpPerfLog(); |
|
57 |
|
58 inline void Write( const TDesC& aText); |
|
59 inline void WriteFormat( TRefByValue<const TDesC> aFmt, ... ); |
|
60 |
|
61 inline void Start( const TDesC& aDescription ); |
|
62 inline void Stop( const TDesC& aDescription ); |
|
63 |
|
64 private: |
|
65 |
|
66 inline CMmMtpDpPerfLog(); |
|
67 inline void ConstructL( const TDesC& aTitle ); |
|
68 |
|
69 private: |
|
70 |
|
71 TMmMtpDpOverflowHandler iOverflowHandler; |
|
72 |
|
73 HBufC16* iTitle; |
|
74 CDesC16ArrayFlat iDescription; |
|
75 CArrayFixFlat<TUint32> iStartTick; |
|
76 CArrayFixFlat<TUint64> iTotalTime; |
|
77 CArrayFixFlat<TUint32> iTotalUsage; |
|
78 |
|
79 TInt iNTickPeriod; |
|
80 TInt iLastIndex; |
|
81 |
|
82 }; |
|
83 |
|
84 #include "cmmmtpdpperflog.inl" |
|
85 |
|
86 #endif // defined(_DEBUG) || defined(MMMTPDP_PERFLOG) |
|
87 #endif // CMMMTPDPPERFLOG_H |