1 // Copyright (c) 2008-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 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalTechnology |
|
19 @prototype |
|
20 */ |
|
21 |
|
22 #ifndef TILSTRUCT_INL |
|
23 #define TILSTRUCT_INL |
|
24 |
|
25 /** |
|
26 Constructor |
|
27 */ |
|
28 inline TILStruct::TILStruct() |
|
29 : |
|
30 iUid(KNullUid) |
|
31 { |
|
32 } |
|
33 |
|
34 /** |
|
35 Obtain the UID identifying the structure. |
|
36 @return The identifying UID of the structure. |
|
37 */ |
|
38 inline const TUid& TILStruct::Uid() const |
|
39 { |
|
40 return iUid; |
|
41 } |
|
42 |
|
43 /** |
|
44 Constructor |
|
45 @param aParameterStructure The structure to store |
|
46 */ |
|
47 template <TInt32 U, class T> |
|
48 inline TILStructParam<U,T>::TILStructParam(const T& aParameterStructure) |
|
49 { |
|
50 iUid = TUid::Uid(U); |
|
51 iBuf = TPckgBuf<T>(aParameterStructure); |
|
52 } |
|
53 |
|
54 /** |
|
55 Default Constructor |
|
56 */ |
|
57 template <TInt32 U, class T> |
|
58 inline TILStructParam<U,T>::TILStructParam() |
|
59 { |
|
60 iUid = TUid::Uid(U); |
|
61 } |
|
62 |
|
63 /** |
|
64 Operator to return the structure represented by the class. |
|
65 @return The structure represented by the class. |
|
66 */ |
|
67 template <TInt32 U, class T> |
|
68 inline TILStructParam<U,T>::operator T&() |
|
69 { |
|
70 return iBuf(); |
|
71 } |
|
72 |
|
73 /** |
|
74 Static method to return the structure represented by TILStruct. |
|
75 @param A const reference to the base structure. |
|
76 @return A const pointer to the structure represented by the class. |
|
77 */ |
|
78 template <TInt32 U, class T> |
|
79 inline const T* TILStructParam<U,T>::GetStructure(const TILStruct& aConfig) |
|
80 { |
|
81 const T* ptr = &((static_cast<const TILStructParam<U,T>& >(aConfig)).iBuf()); |
|
82 return ptr; |
|
83 } |
|
84 |
|
85 /** |
|
86 Static method to return the structure represented by TILStruct. |
|
87 @param A reference to the base structure. |
|
88 @return A pointer to the structure represented by the class. |
|
89 */ |
|
90 template <TInt32 U, class T> |
|
91 inline T* TILStructParam<U,T>::GetStructure(TILStruct& aConfig) |
|
92 { |
|
93 T* ptr = &((static_cast<TILStructParam<U,T>& >(aConfig)).iBuf()); |
|
94 return ptr; |
|
95 } |
|
96 |
|
97 |
|
98 |
|
99 #endif // TILSTRUCT_INL |
|