sl@0: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Mda\Common\Base.inl sl@0: // Inline functions for package classes defined in MdaBase.h sl@0: // sl@0: // sl@0: sl@0: inline TPtr8& TMdaRawPackage::Package() sl@0: { sl@0: ((TMdaRawPackage*)this)->iThis.Set((TUint8*)this,iThis.Length(),iThis.MaxLength()); sl@0: return iThis; sl@0: } sl@0: sl@0: inline const TPtr8& TMdaRawPackage::Package() const sl@0: { sl@0: ((TMdaRawPackage*)this)->iThis.Set((TUint8*)this,iThis.Length(),iThis.MaxLength()); sl@0: return iThis; sl@0: } sl@0: sl@0: inline void TMdaRawPackage::SetSize(TInt aDerivedSize) sl@0: { sl@0: iThis.Set((TUint8*)this,aDerivedSize,aDerivedSize); sl@0: } sl@0: sl@0: /** sl@0: Gets the package type. This is set during construction of the derived class. sl@0: sl@0: @return A UID that identifies the package type. sl@0: */ sl@0: inline TUid TMdaPackage::Type() const sl@0: { sl@0: return iType; sl@0: } sl@0: sl@0: /** sl@0: Gets the derived class's type. This is set during construction of the derived class. sl@0: sl@0: @return A UID that identifies the type of the derived class. sl@0: */ sl@0: inline TUid TMdaPackage::Uid() const sl@0: { sl@0: return iUid; sl@0: } sl@0: sl@0: /** sl@0: Equality operator. Tests whether the package specified has the same UID and type as this package. sl@0: sl@0: @param aPackage sl@0: The package to compare with this one. sl@0: sl@0: @return True if the two packages are the same, false if not. sl@0: */ sl@0: inline TBool TMdaPackage::operator==(const TMdaPackage& aPackage) sl@0: { sl@0: return ((aPackage.Type()==Type())&&(aPackage.Uid()==Uid())); sl@0: } sl@0: sl@0: inline void TMdaPackage::SetUid(TUid aUid) sl@0: { sl@0: iUid = aUid; sl@0: } sl@0: sl@0: inline TMdaRawPackage::TMdaRawPackage(TInt aDerivedSize) sl@0: #pragma warning( disable : 4355 ) // 'this' : used in base member initializer list sl@0: : iThis((TUint8*)this,aDerivedSize,aDerivedSize) sl@0: #pragma warning( default : 4355 ) sl@0: { sl@0: } sl@0: sl@0: /** sl@0: Protected constructor with two UIDs and the size of the derived class. sl@0: sl@0: @param aType sl@0: A UID that identifies the package's concrete class. sl@0: @param aUid sl@0: A UID that identifies the package type. This may be KNullUid if not required. sl@0: @param aDerivedSize sl@0: The size of the derived class. sl@0: */ sl@0: inline TMdaPackage::TMdaPackage(TUid aType, TUid aUid, TInt aDerivedSize) sl@0: : TMdaRawPackage(aDerivedSize),iType(aType),iUid(aUid) sl@0: { sl@0: }