1 base.inl |
1 // Copyright (c) 1997-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Mda\Common\Base.inl |
|
15 // Inline functions for package classes defined in MdaBase.h |
|
16 // |
|
17 // |
|
18 |
|
19 inline TPtr8& TMdaRawPackage::Package() |
|
20 { |
|
21 ((TMdaRawPackage*)this)->iThis.Set((TUint8*)this,iThis.Length(),iThis.MaxLength()); |
|
22 return iThis; |
|
23 } |
|
24 |
|
25 inline const TPtr8& TMdaRawPackage::Package() const |
|
26 { |
|
27 ((TMdaRawPackage*)this)->iThis.Set((TUint8*)this,iThis.Length(),iThis.MaxLength()); |
|
28 return iThis; |
|
29 } |
|
30 |
|
31 inline void TMdaRawPackage::SetSize(TInt aDerivedSize) |
|
32 { |
|
33 iThis.Set((TUint8*)this,aDerivedSize,aDerivedSize); |
|
34 } |
|
35 |
|
36 /** |
|
37 Gets the package type. This is set during construction of the derived class. |
|
38 |
|
39 @return A UID that identifies the package type. |
|
40 */ |
|
41 inline TUid TMdaPackage::Type() const |
|
42 { |
|
43 return iType; |
|
44 } |
|
45 |
|
46 /** |
|
47 Gets the derived class's type. This is set during construction of the derived class. |
|
48 |
|
49 @return A UID that identifies the type of the derived class. |
|
50 */ |
|
51 inline TUid TMdaPackage::Uid() const |
|
52 { |
|
53 return iUid; |
|
54 } |
|
55 |
|
56 /** |
|
57 Equality operator. Tests whether the package specified has the same UID and type as this package. |
|
58 |
|
59 @param aPackage |
|
60 The package to compare with this one. |
|
61 |
|
62 @return True if the two packages are the same, false if not. |
|
63 */ |
|
64 inline TBool TMdaPackage::operator==(const TMdaPackage& aPackage) |
|
65 { |
|
66 return ((aPackage.Type()==Type())&&(aPackage.Uid()==Uid())); |
|
67 } |
|
68 |
|
69 inline void TMdaPackage::SetUid(TUid aUid) |
|
70 { |
|
71 iUid = aUid; |
|
72 } |
|
73 |
|
74 inline TMdaRawPackage::TMdaRawPackage(TInt aDerivedSize) |
|
75 #pragma warning( disable : 4355 ) // 'this' : used in base member initializer list |
|
76 : iThis((TUint8*)this,aDerivedSize,aDerivedSize) |
|
77 #pragma warning( default : 4355 ) |
|
78 { |
|
79 } |
|
80 |
|
81 /** |
|
82 Protected constructor with two UIDs and the size of the derived class. |
|
83 |
|
84 @param aType |
|
85 A UID that identifies the package's concrete class. |
|
86 @param aUid |
|
87 A UID that identifies the package type. This may be KNullUid if not required. |
|
88 @param aDerivedSize |
|
89 The size of the derived class. |
|
90 */ |
|
91 inline TMdaPackage::TMdaPackage(TUid aType, TUid aUid, TInt aDerivedSize) |
|
92 : TMdaRawPackage(aDerivedSize),iType(aType),iUid(aUid) |
|
93 { |
|
94 } |