TLiwGenericParam Class Reference

class TLiwGenericParam

Generic parameter class for passing data between applications. A generic parameter is a pair of semantic ID and variant value. The semantic ID tells the purpose of the parameter, for example a file name, URL or phone number. The variant value contains the data format and actual value. This class does not implement any consistency checks between the semantic ID and value's data format. So one semantic ID can be expressed as alternative data formats.

ServiceHandler.lib
Since
Series 60 2.6
TLiwVariant CLiwGenericParamList

Constructor & Destructor Documentation

TLiwGenericParam()

TLiwGenericParam()[inline]

Constructs a generic parameter.

TLiwGenericParam(LIW::TGenericParamId)

TLiwGenericParam(LIW::TGenericParamIdaSemanticId)[inline]

Constructs a generic parameter.

Parameters

LIW::TGenericParamId aSemanticIdThe semantic ID of the parameter, one of TGenericParamId values.

TLiwGenericParam(LIW::TGenericParamId, const TLiwVariant &)

TLiwGenericParam(LIW::TGenericParamIdaSemanticId,
const TLiwVariant &aValue
)[inline]

Constructs a generic parameter.

Parameters

LIW::TGenericParamId aSemanticIdThe semantic ID of the parameter, one of TGenericParamId values.
const TLiwVariant & aValueThe parameter value.

TLiwGenericParam(const TDesC8 &, const TLiwVariant &)

TLiwGenericParam(const TDesC8 &aName,
const TLiwVariant &aValue
)[inline]

Constructs a generic parameter.

Parameters

const TDesC8 & aNameName of the generic parameter
const TLiwVariant & aValueThe parameter value.

Member Functions Documentation

CleanupDestroy(TAny *)

voidCleanupDestroy(TAny *aObj)[private, static]

Callback for operator TCleanupItem().

Parameters

TAny * aObj

CopyLC(const TLiwGenericParam &)

voidCopyLC(const TLiwGenericParam &aParam)[private]

Copies aParam to this parameter. Takes an own copy of the value held in aParam.

Parameters

const TLiwGenericParam & aParam

Destroy()

voidDestroy()[private]

Releases any dynamic data owned by this parameter.

ExternalizeL(RWriteStream &)

voidExternalizeL(RWriteStream &aStream)const [private]

Externalizes this parameter to aStream.

Parameters

RWriteStream & aStream

InternalizeL(RReadStream &)

voidInternalizeL(RReadStream &aStream)[private]

Internalizes this parameter from aStream.

Parameters

RReadStream & aStream

Name()

const TDesC8 &Name()const [inline]

Returns the name of this parameter.

ParamCleanup(TAny *)

IMPORT_C voidParamCleanup(TAny *aObj)[static]

TLiwGenericParam cleanup method

!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Parameters can be pushed into the CleanupStack using this method along with TCleanupItem

@ param aObj - TLiwGenericParam Object but of type TAny* for usage with TCleanupItem

Example 1: Here the client explicitly pushes the parameter into the CleanupStack using TCleanupItem

	TLiwGenericParam param;
	CleanupStack::PushL( TCleanupItem( TLiwGenericParam::ParamCleanup , &param ) ); 
	User::Leave(KErrGeneral);  //This calls the ParamCleanup method which cleans up TLiwGenericParam 
   CleanupStack::Pop(&param);
	param.Reset();

Example 2: Here the client calls the PushL method of TLiwGenericParam which pushes the object into the CleanupStack using TCleanupItem

	TLiwGenericParam param;
	param.PushL();				
	User::Leave(KErrGeneral);  //This calls the ParamCleanup method which cleans up TLiwGenericParam 
   CleanupStack::Pop(&param);
	param.Reset();

The clients can use the convenient PushL method which is recommended (as shown in e.g 2) rather than explicitly pushing the parameter object into the CleanupStack using TCleanupItem and ParamCleanup.

@ see PushL() method

Parameters

TAny * aObj

PushL()

IMPORT_C voidPushL()

A friendly and convenient method to push the TLiwGenericParam Object into the CleanupStack

!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!

This method informs the CleanupStack that ParamCleanup method should be called incase of any Leave

Example:

	TLiwGenericParam param;
	param.PushL();				//This pushes the parameter object "param" into the CleanupStack using TCleanupItem and ParamCleanup.
	User::Leave(KErrGeneral);  	//This calls the ParamCleanup method which cleans up TLiwGenericParam
   CleanupStack::Pop(&param);	//These statements are not executed
	param.Reset();

This method is recommended than explicitly pushing the parameter object into the CleanupStack using TCleanupItem and ParamCleanup.

ParamCleanup() method

Reset()

voidReset()[inline]

Resets the semantic ID and the value of this parameter.

SemanticId()

LIW::TGenericParamId SemanticId()const [inline]

Returns the semantic ID of this parameter.

SetNameAndValueL(const TDesC8 &, const TLiwVariant &)

voidSetNameAndValueL(const TDesC8 &aName,
const TLiwVariant &aValue
)[inline]

Set name and value. Possibly set previous name and value is overwritten.

Parameters

const TDesC8 & aNamethe parameter name.
const TLiwVariant & aValuethe parameter value

SetNameL(const TDesC8 &)

voidSetNameL(const TDesC8 &aName)[inline]

Set name. Possibly set previous name is overwritten.

Parameters

const TDesC8 & aNameParameter name.

SetSemanticId(LIW::TGenericParamId)

voidSetSemanticId(LIW::TGenericParamIdaSemanticId)[inline]

Sets the semantic ID. Possibly set previous ID is overwritten.

Parameters

LIW::TGenericParamId aSemanticIdThe semantic ID of the parameter.

Size()

TInt Size()const [private]

Returns the maximum externalized size of this parameter.

Value()

TLiwVariant &Value()[inline]

Returns the value of this parameter.

Value()

const TLiwVariant &Value()const [inline]

Returns the const value of this parameter.

operator TCleanupItem()

operator TCleanupItem()[private]

Returns a cleanup item that will call Destroy to this object when PopAndDestroy'ed.

Member Data Documentation

TAny * iReserved

TAny *iReserved[private]

LIW::TGenericParamId iSemanticId

LIW::TGenericParamId iSemanticId[private]

TLiwVariant iValue

TLiwVariant iValue[private]