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