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