videoutils_plat/videoconnutility_api/tsrc/VCXTestCommon/src/VCXTestTimerWait.cpp
branchRCL_3
changeset 22 826cea16efd9
parent 21 798ee5f1972c
child 23 13a33d82ad98
equal deleted inserted replaced
21:798ee5f1972c 22:826cea16efd9
     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 the License "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 //  INCLUDES
       
    20 #include <e32base.h>
       
    21 
       
    22 #include "CIptvTestActiveWait.h"
       
    23 #include "CIptvTestTimer.h"
       
    24 #include "VCXTestTimerWait.h"
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // CTestTimerWait::NewL
       
    28 // -----------------------------------------------------------------------------
       
    29 //
       
    30 EXPORT_C CVCXTestTimerWait* CVCXTestTimerWait::NewL()
       
    31     {
       
    32     CVCXTestTimerWait* self = new (ELeave) CVCXTestTimerWait();
       
    33     CleanupStack::PushL(self);
       
    34     self->ConstructL();
       
    35     CleanupStack::Pop(self);
       
    36     return self;
       
    37     }
       
    38 
       
    39 // -----------------------------------------------------------------------------
       
    40 // CVCXTestTimerWait::CVCXTestTimerWait
       
    41 // -----------------------------------------------------------------------------
       
    42 //
       
    43 CVCXTestTimerWait::CVCXTestTimerWait()
       
    44     {
       
    45 
       
    46     }
       
    47 
       
    48 // -----------------------------------------------------------------------------
       
    49 // CVCXTestTimerWait::ConstructL
       
    50 // -----------------------------------------------------------------------------
       
    51 //
       
    52 EXPORT_C void CVCXTestTimerWait::ConstructL()
       
    53     {
       
    54     iWait = CIptvTestActiveWait::NewL();
       
    55     iTimer = CIptvTestTimer::NewL(*this, 0);
       
    56     }
       
    57 
       
    58 // -----------------------------------------------------------------------------
       
    59 // CVCXTestTimerWait::~CVCXTestTimerWait
       
    60 // -----------------------------------------------------------------------------
       
    61 //
       
    62 EXPORT_C CVCXTestTimerWait::~CVCXTestTimerWait()
       
    63     {
       
    64     if(iTimer != NULL)
       
    65         {
       
    66         iTimer->CancelTimer();
       
    67         delete iTimer;
       
    68         iTimer = NULL;
       
    69         }
       
    70 
       
    71     if( iWait )
       
    72         {
       
    73         iWait->Stop();
       
    74         delete iWait;
       
    75         iWait = NULL;
       
    76         }
       
    77     }
       
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 // CVCXTestTimerWait::WaitL
       
    81 // -----------------------------------------------------------------------------
       
    82 //
       
    83 EXPORT_C void CVCXTestTimerWait::WaitL( TUint32 aMicroSeconds )
       
    84     {
       
    85     iTimer->After( aMicroSeconds );
       
    86     iWait->Start();
       
    87     }
       
    88 
       
    89 // -----------------------------------------------------------------------------
       
    90 // CVCXTestTimerWait::TimerComplete
       
    91 // -----------------------------------------------------------------------------
       
    92 //
       
    93 void CVCXTestTimerWait::TimerComplete( TInt /* aTimerId */, TInt /* aError */ )
       
    94     {
       
    95     if( iWait ) iWait->Stop();
       
    96     }
       
    97 
       
    98 // EOF
       
    99