32
|
1 |
/*
|
|
2 |
* Copyright (c) 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: Implementation of CFlexPeriodic class
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
/*
|
|
18 |
* %version: 1 %
|
|
19 |
*/
|
|
20 |
// System include files
|
|
21 |
// User include files go here:
|
|
22 |
#include "inheritedcflextimer.h"
|
|
23 |
//For exteded test result
|
|
24 |
#include "testflextimer.h"
|
|
25 |
// External function prototypes
|
|
26 |
// Local constants go here
|
|
27 |
// Panic category
|
|
28 |
|
|
29 |
// ======== MEMBER FUNCTIONS ========
|
|
30 |
// ---------------------------------------------------------------------------
|
|
31 |
// Constructs the object.
|
|
32 |
// ---------------------------------------------------------------------------
|
|
33 |
//
|
|
34 |
CInheritedCFlexTimer* CInheritedCFlexTimer::NewL( TInt aPriority,
|
|
35 |
TCallBack aCallBack )
|
|
36 |
{
|
|
37 |
|
|
38 |
CInheritedCFlexTimer* self = new (ELeave) CInheritedCFlexTimer(aPriority,
|
|
39 |
aCallBack);
|
|
40 |
CleanupStack::PushL(self);
|
|
41 |
self->ConstructL();
|
|
42 |
CleanupStack::Pop(self);
|
|
43 |
return self;
|
|
44 |
}
|
|
45 |
|
|
46 |
// ---------------------------------------------------------------------------
|
|
47 |
// Destructs the object.
|
|
48 |
// ---------------------------------------------------------------------------
|
|
49 |
//
|
|
50 |
CInheritedCFlexTimer::~CInheritedCFlexTimer()
|
|
51 |
{
|
|
52 |
|
|
53 |
}
|
|
54 |
|
|
55 |
// ---------------------------------------------------------------------------
|
|
56 |
// Desc
|
|
57 |
// ---------------------------------------------------------------------------
|
|
58 |
//
|
|
59 |
void CInheritedCFlexTimer::SetCB( TCallBack aCallBack )
|
|
60 |
{
|
|
61 |
iCallBack = aCallBack;
|
|
62 |
}
|
|
63 |
|
|
64 |
// ---------------------------------------------------------------------------
|
|
65 |
// Desc
|
|
66 |
// ---------------------------------------------------------------------------
|
|
67 |
//
|
|
68 |
TInt CInheritedCFlexTimer::MyOwnConfigure(
|
|
69 |
TTimeIntervalMicroSeconds32 aDelayWindow )
|
|
70 |
{
|
|
71 |
TInt ret = CFlexTimer::Configure(aDelayWindow);
|
|
72 |
if (ret == KErrNone)
|
|
73 |
{
|
|
74 |
//
|
|
75 |
}
|
|
76 |
return ret;
|
|
77 |
}
|
|
78 |
|
|
79 |
// ---------------------------------------------------------------------------
|
|
80 |
// Handles the active objects request completion event.
|
|
81 |
// ---------------------------------------------------------------------------
|
|
82 |
//
|
|
83 |
void CInheritedCFlexTimer::RunL()
|
|
84 |
{
|
|
85 |
//Give code to test case
|
|
86 |
TExtendedTestResult *eRes =
|
|
87 |
reinterpret_cast<TExtendedTestResult*> (iCallBack.iPtr);
|
|
88 |
eRes->iStatusCode = iStatus.Int();
|
|
89 |
iCallBack.CallBack();
|
|
90 |
}
|
|
91 |
|
|
92 |
// ---------------------------------------------------------------------------
|
|
93 |
// Second part of the two-phase construction.
|
|
94 |
// ---------------------------------------------------------------------------
|
|
95 |
//
|
|
96 |
void CInheritedCFlexTimer::ConstructL()
|
|
97 |
{
|
|
98 |
CActiveScheduler::Add(this);
|
|
99 |
CFlexTimer::ConstructL();
|
|
100 |
}
|
|
101 |
|
|
102 |
// ---------------------------------------------------------------------------
|
|
103 |
// Private constructor with priority.
|
|
104 |
// ---------------------------------------------------------------------------
|
|
105 |
//
|
|
106 |
CInheritedCFlexTimer::CInheritedCFlexTimer( TInt aPriority,
|
|
107 |
TCallBack aCallBack ) :
|
|
108 |
CFlexTimer(aPriority), iCallBack(aCallBack)
|
|
109 |
{
|
|
110 |
|
|
111 |
}
|