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.
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 |
TLiwGenericParam | ( | LIW::TGenericParamId | aSemanticId | ) | [inline] |
Constructs a generic parameter.
LIW::TGenericParamId aSemanticId | The semantic ID of the parameter, one of TGenericParamId values. |
TLiwGenericParam | ( | LIW::TGenericParamId | aSemanticId, |
const TLiwVariant & | aValue | ||
) | [inline] |
Constructs a generic parameter.
LIW::TGenericParamId aSemanticId | The semantic ID of the parameter, one of TGenericParamId values. |
const TLiwVariant & aValue | The parameter value. |
TLiwGenericParam | ( | const TDesC8 & | aName, |
const TLiwVariant & | aValue | ||
) | [inline] |
Constructs a generic parameter.
const TDesC8 & aName | Name of the generic parameter |
const TLiwVariant & aValue | The parameter value. |
void | CleanupDestroy | ( | TAny * | aObj | ) | [private, static] |
Callback for operator TCleanupItem().
TAny * aObj |
void | CopyLC | ( | const TLiwGenericParam & | aParam | ) | [private] |
Copies aParam to this parameter. Takes an own copy of the value held in aParam.
const TLiwGenericParam & aParam |
void | ExternalizeL | ( | RWriteStream & | aStream | ) | const [private] |
Externalizes this parameter to aStream.
RWriteStream & aStream |
void | InternalizeL | ( | RReadStream & | aStream | ) | [private] |
Internalizes this parameter from aStream.
RReadStream & aStream |
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 , ¶m ) ); User::Leave(KErrGeneral); //This calls the ParamCleanup method which cleans up TLiwGenericParam CleanupStack::Pop(¶m); 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(¶m); 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
TAny * aObj |
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(¶m); //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
LIW::TGenericParamId | SemanticId | ( | ) | const [inline] |
Returns the semantic ID of this parameter.
void | SetNameAndValueL | ( | const TDesC8 & | aName, |
const TLiwVariant & | aValue | |||
) | [inline] |
Set name and value. Possibly set previous name and value is overwritten.
const TDesC8 & aName | the parameter name. |
const TLiwVariant & aValue | the parameter value |
void | SetNameL | ( | const TDesC8 & | aName | ) | [inline] |
Set name. Possibly set previous name is overwritten.
const TDesC8 & aName | Parameter name. |
void | SetSemanticId | ( | LIW::TGenericParamId | aSemanticId | ) | [inline] |
Sets the semantic ID. Possibly set previous ID is overwritten.
LIW::TGenericParamId aSemanticId | The semantic ID of the parameter. |
operator TCleanupItem | ( | ) | [private] |
Returns a cleanup item that will call Destroy to this object when PopAndDestroy'ed.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.