|
1 /* |
|
2 * Copyright (c) 2007 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: Provides ResetAndDestroy for RPointerArrays. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef DIAGCLEANUPRESETANDDESTROY_H |
|
20 #define DIAGCLEANUPRESETANDDESTROY_H |
|
21 |
|
22 // SYSTEM INCLUDES |
|
23 #include <e32def.h> // TAny |
|
24 |
|
25 // FORWARD DECLARATION |
|
26 template< class T > |
|
27 class RPointerArray; |
|
28 |
|
29 namespace DiagFwInternal |
|
30 { |
|
31 |
|
32 /** |
|
33 * Cleanup function for RPointerArray or any other types with ResetAndDestroy() |
|
34 * @usage |
|
35 * RPointerArray< CDiagResultsDatabaseItem > myArray; |
|
36 * CleanupStack::PushL( TCleanupItem( |
|
37 * DiagFwInternal::CleanupResetAndDestroy< RPointerArray< CDiagResultsDatabaseItem > >, |
|
38 * &myArray ) ); |
|
39 * |
|
40 * ... |
|
41 * |
|
42 * CleanupStack::PopAndDestroy( &myArray ); |
|
43 */ |
|
44 template< class T > |
|
45 inline void CleanupResetAndDestroy( TAny* aObj ); |
|
46 |
|
47 /** |
|
48 * Push a RPointerArray of templated type to cleanup stack |
|
49 * @usage |
|
50 * RPointerArray< CDiagResultsDatabaseItem > myArray; |
|
51 * DiagFwInternal::CleanupRPointerArrayPushL< CDiagResultsDatabaseItem >( &myArray ); |
|
52 * |
|
53 * ... |
|
54 * |
|
55 * CleanupStack::PopAndDestroy( &myArray ); |
|
56 */ |
|
57 template< class T > |
|
58 inline void CleanupRPointerArrayPushL( RPointerArray< T >* aObj ); |
|
59 |
|
60 } |
|
61 |
|
62 // Inline methods |
|
63 #include "diagcleanupresetanddestroy.inl" |
|
64 |
|
65 #endif // DIAGCLEANUPRESETANDDESTROY_H |
|
66 |
|
67 // End of File |
|
68 |