TLiwGenericParam Class Reference
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.
Constructor & Destructor Documentation
TLiwGenericParam()
TLiwGenericParam | ( | ) | [inline] |
Constructs a generic parameter.
TLiwGenericParam(LIW::TGenericParamId)
Constructs a generic parameter.
TLiwGenericParam(LIW::TGenericParamId, const TLiwVariant &)
Constructs a generic parameter.
TLiwGenericParam(const TDesC8 &, const TLiwVariant &)
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().
CopyLC(const TLiwGenericParam &)
Copies aParam to this parameter. Takes an own copy of the value held in aParam.
Destroy()
Releases any dynamic data owned by this parameter.
ExternalizeL(RWriteStream &)
Externalizes this parameter to aStream.
InternalizeL(RReadStream &)
Internalizes this parameter from 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 , ¶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
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
Reset()
Resets the semantic ID and the value of this parameter.
SemanticId()
Returns the semantic ID of this parameter.
SetNameAndValueL(const TDesC8 &, const TLiwVariant &)
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)
Sets the semantic ID. Possibly set previous ID is overwritten.
Size()
TInt
| Size | ( | ) | const [private] |
Returns the maximum externalized size of this parameter.
Value()
Returns the value of this parameter.
Value()
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
LIW::TGenericParamId
iSemanticId
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.