1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/inc/Mda/Common/Base.inl Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,94 @@
1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// Mda\Common\Base.inl
1.18 +// Inline functions for package classes defined in MdaBase.h
1.19 +//
1.20 +//
1.21 +
1.22 +inline TPtr8& TMdaRawPackage::Package()
1.23 + {
1.24 + ((TMdaRawPackage*)this)->iThis.Set((TUint8*)this,iThis.Length(),iThis.MaxLength());
1.25 + return iThis;
1.26 + }
1.27 +
1.28 +inline const TPtr8& TMdaRawPackage::Package() const
1.29 + {
1.30 + ((TMdaRawPackage*)this)->iThis.Set((TUint8*)this,iThis.Length(),iThis.MaxLength());
1.31 + return iThis;
1.32 + }
1.33 +
1.34 +inline void TMdaRawPackage::SetSize(TInt aDerivedSize)
1.35 + {
1.36 + iThis.Set((TUint8*)this,aDerivedSize,aDerivedSize);
1.37 + }
1.38 +
1.39 +/**
1.40 +Gets the package type. This is set during construction of the derived class.
1.41 +
1.42 +@return A UID that identifies the package type.
1.43 +*/
1.44 +inline TUid TMdaPackage::Type() const
1.45 + {
1.46 + return iType;
1.47 + }
1.48 +
1.49 +/**
1.50 +Gets the derived class's type. This is set during construction of the derived class.
1.51 +
1.52 +@return A UID that identifies the type of the derived class.
1.53 +*/
1.54 +inline TUid TMdaPackage::Uid() const
1.55 + {
1.56 + return iUid;
1.57 + }
1.58 +
1.59 +/**
1.60 +Equality operator. Tests whether the package specified has the same UID and type as this package.
1.61 +
1.62 +@param aPackage
1.63 + The package to compare with this one.
1.64 +
1.65 +@return True if the two packages are the same, false if not.
1.66 +*/
1.67 +inline TBool TMdaPackage::operator==(const TMdaPackage& aPackage)
1.68 + {
1.69 + return ((aPackage.Type()==Type())&&(aPackage.Uid()==Uid()));
1.70 + }
1.71 +
1.72 +inline void TMdaPackage::SetUid(TUid aUid)
1.73 + {
1.74 + iUid = aUid;
1.75 + }
1.76 +
1.77 +inline TMdaRawPackage::TMdaRawPackage(TInt aDerivedSize)
1.78 +#pragma warning( disable : 4355 ) // 'this' : used in base member initializer list
1.79 +: iThis((TUint8*)this,aDerivedSize,aDerivedSize)
1.80 +#pragma warning( default : 4355 )
1.81 + {
1.82 + }
1.83 +
1.84 +/**
1.85 +Protected constructor with two UIDs and the size of the derived class.
1.86 +
1.87 +@param aType
1.88 + A UID that identifies the package's concrete class.
1.89 +@param aUid
1.90 + A UID that identifies the package type. This may be KNullUid if not required.
1.91 +@param aDerivedSize
1.92 + The size of the derived class.
1.93 +*/
1.94 +inline TMdaPackage::TMdaPackage(TUid aType, TUid aUid, TInt aDerivedSize)
1.95 +: TMdaRawPackage(aDerivedSize),iType(aType),iUid(aUid)
1.96 + {
1.97 + }