smsprotocols/smsstack/smsu/src/smsutimer.cpp
branchRCL_3
changeset 65 630d2f34d719
parent 0 3553901f7fa8
child 66 07a122eea281
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
     1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    17 
    17 
    18 /**
    18 /**
    19  @file
    19  @file
    20 */
    20 */
    21 
    21 
       
    22 
       
    23 #include "OstTraceDefinitions.h"
       
    24 #ifdef OST_TRACE_COMPILER_IN_USE
       
    25 #include "smsutimerTraces.h"
       
    26 #endif
       
    27 
    22 #include "SmsuTimer.h"
    28 #include "SmsuTimer.h"
    23 
    29 
    24 #include <e32std.h>
    30 #include <e32std.h>
    25 
    31 
    26 #include "smsumain.h"
    32 #include "smsumain.h"
    31  *  
    37  *  
    32  *  @param aActive Reference to an active observer
    38  *  @param aActive Reference to an active observer
    33  */
    39  */
    34 CSmsuTimeout* CSmsuTimeout::NewL(CSmsuActiveBase& aActive)
    40 CSmsuTimeout* CSmsuTimeout::NewL(CSmsuActiveBase& aActive)
    35     {
    41     {
    36     LOGSMSU1("CSmsuTimeout::NewL()");
    42     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUTIMEOUT_NEWL_1, "CSmsuTimeout::NewL()");
    37     
    43     
    38     CSmsuTimeout* self = new(ELeave) CSmsuTimeout(aActive);
    44     CSmsuTimeout* self = new(ELeave) CSmsuTimeout(aActive);
    39     CleanupStack::PushL(self);
    45     CleanupStack::PushL(self);
    40     self->ConstructL();
    46     self->ConstructL();
    41     CleanupStack::Pop(self);
    47     CleanupStack::Pop(self);
    54 /**
    60 /**
    55  *  Start a timeout specified in aTimeIntervalMicroSeconds32
    61  *  Start a timeout specified in aTimeIntervalMicroSeconds32
    56  */
    62  */
    57 void CSmsuTimeout::Start(const TTimeIntervalMicroSeconds32& aTimeIntervalMicroSeconds32)
    63 void CSmsuTimeout::Start(const TTimeIntervalMicroSeconds32& aTimeIntervalMicroSeconds32)
    58 	{
    64 	{
    59 	LOGSMSU1("CSmsuTimeout::Start()");
    65 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUTIMEOUT_START_1, "CSmsuTimeout::Start()");
    60 
    66 
    61 	iTimedOut = EFalse;
    67 	iTimedOut = EFalse;
    62 	After(aTimeIntervalMicroSeconds32);
    68 	After(aTimeIntervalMicroSeconds32);
    63 	} // CSmsuTimeout::Start
    69 	} // CSmsuTimeout::Start
    64 
    70 
    70   : CTimer(aActive.Priority()),
    76   : CTimer(aActive.Priority()),
    71 	iActive(aActive),
    77 	iActive(aActive),
    72 	iTimedOut(EFalse),
    78 	iTimedOut(EFalse),
    73 	iCompleteMyselfRequested(EFalse)
    79 	iCompleteMyselfRequested(EFalse)
    74 	{
    80 	{
    75 	LOGSMSU1("CSmsuTimeout::CSmsuTimeout()");
    81 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUTIMEOUT_CTOR_1, "CSmsuTimeout::CSmsuTimeout()");
    76 
    82 
    77 	CActiveScheduler::Add(this);
    83 	CActiveScheduler::Add(this);
    78 	} // CSmsuTimeout::CSmsuTimeout
    84 	} // CSmsuTimeout::CSmsuTimeout
    79 
    85 
    80 
    86 
    81 /**
    87 /**
    82  *  Timer completed - cancel the observer
    88  *  Timer completed - cancel the observer
    83  */
    89  */
    84 void CSmsuTimeout::RunL()
    90 void CSmsuTimeout::RunL()
    85 	{
    91 	{
    86 	LOGSMSU2("CSmsuTimeout::RunL [iStatus=%d]", iStatus.Int() );
    92 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSUTIMEOUT_RUNL_1, "CSmsuTimeout::RunL [iStatus=%d]", iStatus.Int() );
    87 	iTimedOut = ETrue;
    93 	iTimedOut = ETrue;
    88 	iActive.Cancel();
    94 	iActive.Cancel();
    89 
    95 
    90 	//
    96 	//
    91 	// It would be nice to call a DoTimeout() function here,
    97 	// It would be nice to call a DoTimeout() function here,