|
1 /* |
|
2 * Copyright (c) 2004 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: One value adapter for generic array. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef TPENGGENARRAYADAPTER_H__ |
|
19 #define TPENGGENARRAYADAPTER_H__ |
|
20 |
|
21 // INCLUDES |
|
22 #include <E32Std.h> |
|
23 |
|
24 |
|
25 |
|
26 // CLASS DECLARATION |
|
27 /** |
|
28 * One value adapter for generic array. |
|
29 * |
|
30 * @since 3.0 |
|
31 */ |
|
32 template <class T> |
|
33 class TPEngGenArrayAdapter |
|
34 { |
|
35 public: //Constructor & destructor |
|
36 |
|
37 /** |
|
38 * C++ constructor. |
|
39 * Takes the value to adapt. |
|
40 */ |
|
41 inline TPEngGenArrayAdapter( const T& aValue ); |
|
42 |
|
43 |
|
44 /** |
|
45 * Destructor. |
|
46 */ |
|
47 inline ~TPEngGenArrayAdapter(); |
|
48 |
|
49 |
|
50 public: //Generic array |
|
51 |
|
52 |
|
53 /** |
|
54 * Generic array access. |
|
55 * |
|
56 * Returns generic array containing the value |
|
57 * gived in TPEngGenArrayAdapter construction |
|
58 * parameter. |
|
59 */ |
|
60 inline TArray< T > Array() const; |
|
61 |
|
62 |
|
63 |
|
64 private: //Generic array functions |
|
65 |
|
66 inline static TInt CountFunction( const CBase* aThis ); |
|
67 inline static const TAny* AtFunction( const CBase* aThis, |
|
68 TInt aIndex ); |
|
69 |
|
70 |
|
71 private: //Data |
|
72 |
|
73 //REF: Adapted value |
|
74 const T& iValue; |
|
75 |
|
76 }; |
|
77 |
|
78 |
|
79 // Inline methods |
|
80 #include "TPEngGenArrayAdapter.inl" |
|
81 |
|
82 #endif //TPENGGENARRAYADAPTER_H__ |
|
83 // End of File |
|
84 |
|
85 |
|
86 |