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
Public Member Functions
TLiwGenericParam ()
TLiwGenericParam ( LIW::TGenericParamId )
TLiwGenericParam ( LIW::TGenericParamId , const TLiwVariant &)
TLiwGenericParam (const TDesC8 &, const TLiwVariant &)
const TDesC8 & Name ()
IMPORT_C void ParamCleanup ( TAny *)
IMPORT_C void PushL ()
void Reset ()
LIW::TGenericParamId SemanticId ()
void SetNameAndValueL (const TDesC8 &, const TLiwVariant &)
void SetNameL (const TDesC8 &)
void SetSemanticId ( LIW::TGenericParamId )
TLiwVariant & Value ()
const TLiwVariant & Value ()
Private Member Functions
void CleanupDestroy ( TAny *)
void CopyLC (const TLiwGenericParam &)
void Destroy ()
void ExternalizeL ( RWriteStream &)
void InternalizeL ( RReadStream &)
TInt Size ()
operator TCleanupItem ()
Private Attributes
TAny * iReserved
LIW::TGenericParamId iSemanticId
TLiwVariant iValue

Constructor & Destructor Documentation

TLiwGenericParam()

TLiwGenericParam ( ) [inline]

Constructs a generic parameter.

TLiwGenericParam(LIW::TGenericParamId)

TLiwGenericParam ( LIW::TGenericParamId aSemanticId ) [inline]

Constructs a generic parameter.

Parameters

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

TLiwGenericParam(LIW::TGenericParamId, const TLiwVariant &)

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

Constructs a generic parameter.

Parameters

LIW::TGenericParamId aSemanticId The semantic ID of the parameter, one of TGenericParamId values.
const TLiwVariant & aValue The parameter value.

TLiwGenericParam(const TDesC8 &, const TLiwVariant &)

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

Constructs a generic parameter.

Parameters

const TDesC8 & aName Name of the generic parameter
const TLiwVariant & aValue The parameter value.

Member Functions Documentation

CleanupDestroy(TAny *)

void CleanupDestroy ( TAny * aObj ) [private, static]

Callback for operator TCleanupItem().

Parameters

TAny * aObj

CopyLC(const TLiwGenericParam &)

void CopyLC ( const TLiwGenericParam & aParam ) [private]

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

Parameters

const TLiwGenericParam & aParam

Destroy()

void Destroy ( ) [private]

Releases any dynamic data owned by this parameter.

ExternalizeL(RWriteStream &)

void ExternalizeL ( RWriteStream & aStream ) const [private]

Externalizes this parameter to aStream.

Parameters

RWriteStream & aStream

InternalizeL(RReadStream &)

void InternalizeL ( 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 void ParamCleanup ( 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 void PushL ( )

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()

void Reset ( ) [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 &)

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

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

Parameters

const TDesC8 & aName the parameter name.
const TLiwVariant & aValue the parameter value

SetNameL(const TDesC8 &)

void SetNameL ( const TDesC8 & aName ) [inline]

Set name. Possibly set previous name is overwritten.

Parameters

const TDesC8 & aName Parameter name.

SetSemanticId(LIW::TGenericParamId)

void SetSemanticId ( LIW::TGenericParamId aSemanticId ) [inline]

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

Parameters

LIW::TGenericParamId aSemanticId The 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]