realtimenetprots/sipfw/SIP/TransactionUser/src/TimerValues.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2007-2009 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:
       
    15 * Name          : TimerValues.h
       
    16 * Part of       : TransactionUser
       
    17 * Version       : SIP/6.0
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @internalComponent
       
    26 */
       
    27 
       
    28 #ifndef TIMERVALUES_H
       
    29 #define TIMERVALUES_H
       
    30 
       
    31 // INCLUDES
       
    32 #include <e32base.h>
       
    33 
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38  * TTimerValues wraps together the values of timers which are read from
       
    39  * a configuration file.
       
    40  */
       
    41 class TTimerValues
       
    42 	{
       
    43 public: // Constructors
       
    44 	
       
    45 	/**
       
    46 	 * Default constructor
       
    47 	 */
       
    48 	TTimerValues();
       
    49 	
       
    50 	/**
       
    51 	 * Constructor
       
    52 	 *
       
    53 	 * @param aT1 Value for T1
       
    54 	 * @param aT2 Value for T2
       
    55 	 * @param aT4 Value for T4
       
    56 	 */
       
    57 	TTimerValues(TUint aT1, TUint aT2, TUint aT4);
       
    58 
       
    59 public: // New functions
       
    60 
       
    61 	/**
       
    62 	 * Checks if the timer values are reasonable. If they aren't, function
       
    63      * leaves.
       
    64 	 *
       
    65 	 * @return value ETrue if the values are ok, EFalse otherwise.
       
    66 	 */
       
    67 	TBool CheckValues() const;
       
    68 
       
    69 	/**
       
    70 	 * Doubles the value of aDuration, until it reaches T2. If aDuration is
       
    71 	 * zero, it is set to T1.
       
    72 	 *
       
    73 	 * @param aDuration IN: old value of aDuration, OUT: new value	 
       
    74 	 */
       
    75 	void DoubleUptoT2(TUint& aDuration) const;
       
    76 
       
    77 	/**
       
    78 	 * Returns the value of 64 times T1.
       
    79 	 *
       
    80 	 * @return 64xT1
       
    81 	 */
       
    82 	TUint Duration64xT1() const;
       
    83 
       
    84 	/**
       
    85 	 * Returns the value of T1
       
    86 	 *
       
    87 	 * @return T1
       
    88 	 */
       
    89 	TUint T1() const;
       
    90 
       
    91 	/**
       
    92 	 * Returns the value of T2
       
    93 	 *
       
    94 	 * @return T2
       
    95 	 */
       
    96 	TUint T2() const;
       
    97 
       
    98 	/**
       
    99 	 * Returns the value of T4
       
   100 	 *	 
       
   101 	 * @return T4
       
   102 	 */
       
   103 	TUint T4() const;    
       
   104 
       
   105 private: // Data
       
   106 
       
   107 	TUint iT1;
       
   108 	TUint iT2;
       
   109 	TUint iT4;
       
   110 
       
   111 	// For testing purposes
       
   112 #ifdef CPPUNIT_TEST	
       
   113 	friend class CInviteCTa_Calling_Test;
       
   114 	friend class CNormalCTa_Proceeding_Test;
       
   115 	friend class CInviteUAC_WaitAckFromApp_Test;
       
   116 	friend class ClientTransaction_Test;
       
   117 	friend class CServerTransaction_Test;
       
   118     friend class CUserAgentClient_Test;
       
   119     friend class CTransactionUser_Test;
       
   120 #endif	
       
   121 	};
       
   122 
       
   123 #endif // end of TIMERVALUES_H
       
   124 
       
   125 // End of File