85
|
1 |
/*
|
|
2 |
* Copyright (c) 2008 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: ?Description
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
// INCLUDE FILES
|
|
19 |
#include "catimeout.h"
|
|
20 |
|
|
21 |
// ================= MEMBER FUNCTIONS =======================
|
|
22 |
|
|
23 |
// ---------------------------------------------------------
|
|
24 |
// CTimeout::NewL()
|
|
25 |
// ---------------------------------------------------------
|
|
26 |
//
|
|
27 |
CTimeout* CTimeout::NewL( TInt aPriority, TCallBack aCallBack )
|
|
28 |
{
|
|
29 |
CTimeout* timeout = new ( ELeave ) CTimeout( aPriority, aCallBack );
|
|
30 |
CleanupStack::PushL( timeout );
|
|
31 |
timeout->ConstructL();
|
|
32 |
CleanupStack::Pop( timeout );
|
|
33 |
return timeout;
|
|
34 |
}
|
|
35 |
|
|
36 |
// ---------------------------------------------------------
|
|
37 |
// CTimeout::~CTimeout()
|
|
38 |
// ---------------------------------------------------------
|
|
39 |
//
|
|
40 |
CTimeout::~CTimeout()
|
|
41 |
{
|
|
42 |
Cancel();
|
|
43 |
}
|
|
44 |
|
|
45 |
// ---------------------------------------------------------
|
|
46 |
// CTimeout::RunL()
|
|
47 |
// ---------------------------------------------------------
|
|
48 |
//
|
|
49 |
void CTimeout::RunL()
|
|
50 |
{
|
|
51 |
#ifdef _DEBUG
|
|
52 |
TBool again =
|
|
53 |
#endif /* def _DEBUG */
|
|
54 |
iCallBack.CallBack();
|
|
55 |
// Assert that this is a "once-only" callback.
|
|
56 |
__ASSERT_DEBUG( !again, User::Invariant() );
|
|
57 |
}
|
|
58 |
|
|
59 |
// ---------------------------------------------------------
|
|
60 |
// CTimeout::CTimeout()
|
|
61 |
// ---------------------------------------------------------
|
|
62 |
//
|
|
63 |
CTimeout::CTimeout( TInt aPriority, TCallBack aCallBack ) :
|
|
64 |
CTimer( aPriority ), iCallBack( aCallBack )
|
|
65 |
{
|
|
66 |
CActiveScheduler::Add( this );
|
|
67 |
}
|
|
68 |
|
|
69 |
// End of File
|