|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Name : RestoreTransactionState.cpp |
|
15 // Part of : Transaction |
|
16 // Version : SIP/5.0 |
|
17 // |
|
18 |
|
19 |
|
20 |
|
21 #include "SipAssert.h" |
|
22 #include "ClientTransaction.h" |
|
23 #include "RestoreTransactionState.h" |
|
24 #include "TimerBase.h" |
|
25 |
|
26 // ----------------------------------------------------------------------------- |
|
27 // TRestoreTransactionState::TRestoreTransactionState |
|
28 // ----------------------------------------------------------------------------- |
|
29 // |
|
30 TRestoreTransactionState::TRestoreTransactionState( |
|
31 CClientTransaction& aTransaction, |
|
32 const CTransactionState& aState, |
|
33 CTransactionTimer* aTimer, |
|
34 CTransactionTimer* aTimer2) : |
|
35 iTransaction(aTransaction), |
|
36 iState(aState), |
|
37 iTimer(aTimer), |
|
38 iTimer2(aTimer2) |
|
39 { |
|
40 } |
|
41 |
|
42 // ----------------------------------------------------------------------------- |
|
43 // TRestoreTransactionState::CleanupItem |
|
44 // ----------------------------------------------------------------------------- |
|
45 // |
|
46 TCleanupItem TRestoreTransactionState::CleanupItem() |
|
47 { |
|
48 return TCleanupItem(Restore, this); |
|
49 } |
|
50 |
|
51 // ----------------------------------------------------------------------------- |
|
52 // TRestoreTransactionState::Restore |
|
53 // ----------------------------------------------------------------------------- |
|
54 // |
|
55 void TRestoreTransactionState::Restore(TAny* aRestoreState) |
|
56 { |
|
57 __SIP_ASSERT_RETURN(aRestoreState, KErrArgument); |
|
58 |
|
59 TRestoreTransactionState* restore = |
|
60 reinterpret_cast<TRestoreTransactionState*>(aRestoreState); |
|
61 |
|
62 restore->iTransaction.ChangeState(restore->iState); |
|
63 |
|
64 if (restore->iTimer) |
|
65 { |
|
66 restore->iTransaction.DeleteTimer(*restore->iTimer); |
|
67 } |
|
68 if (restore->iTimer2) |
|
69 { |
|
70 restore->iTransaction.DeleteTimer(*restore->iTimer2); |
|
71 } |
|
72 } |