|
1 /* |
|
2 * Copyright (c) 2006 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 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef C_TRANSACTIONCLEANUP_H |
|
22 #define C_TRANSACTIONCLEANUP_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CSTUNTransaction; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 /** |
|
32 * This class is used to terminate the STUN transaction, if a leave occurs |
|
33 * while the transaction was processing a received STUN message. |
|
34 */ |
|
35 class TTransactionCleanup |
|
36 { |
|
37 public: // Constructor |
|
38 |
|
39 /** |
|
40 * Constructor |
|
41 * |
|
42 * @param aTransaction STUN transaction, that will be terminated. |
|
43 */ |
|
44 TTransactionCleanup( CSTUNTransaction& aTransaction ); |
|
45 |
|
46 public: // New functions |
|
47 |
|
48 /** |
|
49 * Returns a TCleanupItem which can be pushed into CleanupStack. |
|
50 * |
|
51 * @return TCleanupItem |
|
52 */ |
|
53 TCleanupItem CleanupItem(); |
|
54 |
|
55 /** |
|
56 * When CleanupStack destroys the TCleanupItem, this function is called. |
|
57 * The iTransaction is terminated. |
|
58 * |
|
59 * @pre aCleanup != NULL |
|
60 * |
|
61 * @param aCleanup Pointer to a TTransactionCleanup. Ownership is not |
|
62 * transferred. |
|
63 */ |
|
64 static void TerminateTransaction( TAny* aCleanup ); |
|
65 |
|
66 private: // Data |
|
67 |
|
68 CSTUNTransaction& iTransaction; |
|
69 }; |
|
70 |
|
71 #endif // C_TRANSACTIONCLEANUP_H |