equal
deleted
inserted
replaced
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
|
17 #ifndef TSUTILS_H |
|
18 #define TSUTILS_H |
|
19 #include <e32base.h> |
|
20 namespace TaskSwitcher { |
|
21 template <class T> |
|
22 void CArrayPtrCleanupMethod(TAny *aPtr) |
|
23 { |
|
24 CArrayPtr<T> *ptr(static_cast< CArrayPtr<T>* >(aPtr)); |
|
25 ptr->ResetAndDestroy(); |
|
26 delete ptr; |
|
27 } |
|
28 |
|
29 template <class T> |
|
30 void CleanupResetAndDestroyPushL(CArrayPtr<T> *array) { |
|
31 CleanupStack::PushL(TCleanupItem(&CArrayPtrCleanupMethod<T>, array)); |
|
32 } |
17 |
33 |
18 namespace TaskSwitcher { |
|
19 template <class T> |
34 template <class T> |
20 void RPointerArrayCleanupMethod(TAny *aPtr) |
35 void RPointerArrayCleanupMethod(TAny *aPtr) |
21 { |
36 { |
22 static_cast< RPointerArray<T>* >(aPtr)->ResetAndDestroy(); |
37 static_cast< RPointerArray<T>* >(aPtr)->ResetAndDestroy(); |
23 } |
38 } |
25 template <class T> |
40 template <class T> |
26 void CleanupResetAndDestroyPushL(RPointerArray<T> &array) { |
41 void CleanupResetAndDestroyPushL(RPointerArray<T> &array) { |
27 CleanupStack::PushL(TCleanupItem(&RPointerArrayCleanupMethod<T>, &array)); |
42 CleanupStack::PushL(TCleanupItem(&RPointerArrayCleanupMethod<T>, &array)); |
28 } |
43 } |
29 } |
44 } |
|
45 #endif//TSUTILS_H |