keepalive/flextimer/server/engine/inc/flextimercontainer.inl
branchRCL_3
changeset 58 83ca720e2b9a
parent 57 05bc53fe583b
child 62 bb1f80fb7db2
equal deleted inserted replaced
57:05bc53fe583b 58:83ca720e2b9a
     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  * Description:
       
    13  * This file contains inline functions of FlexTimerContainer class.
       
    14  *
       
    15  */
       
    16 
       
    17 // Protection against nested includes
       
    18 #ifndef FLEXTIMERCONTAINER_INL
       
    19 #define FLEXTIMERCONTAINER_INL
       
    20 
       
    21 // ---------------------------------------------------------------------------
       
    22 // Converts micro seconds interval to tick based absolute time (also in micro
       
    23 // seconds). All flextimer item time handling in engine is based on this tick
       
    24 // based absolute time. Note that the time is not using system time base.
       
    25 // ---------------------------------------------------------------------------
       
    26 //
       
    27 inline TInt64 CFlexTimerContainer::IntervalToAbsoluteTime(
       
    28     const TTimeIntervalMicroSeconds& aInterval )
       
    29     {
       
    30     TTime tempTime;
       
    31     GetCurrentTime( tempTime );
       
    32 
       
    33     return tempTime.Int64() + aInterval.Int64();
       
    34     }
       
    35 // ---------------------------------------------------------------------------
       
    36 // Converts system ticks to microseconds. 
       
    37 // ---------------------------------------------------------------------------
       
    38 //
       
    39 inline TInt64 CFlexTimerContainer::TicksToAbsoluteTime( const TUint32 aTicks )
       
    40     {
       
    41     return static_cast<TInt64> ( aTicks )
       
    42         * static_cast<TInt64> ( iTickPeriod );
       
    43     }
       
    44 
       
    45 #endif  //FLEXTIMERCONTAINER_INL