Alf::AlfModelOperation Class Reference

class Alf::AlfModelOperation
A class for storing information about changes in the model. CAlfModelOperation can be used to make changes in a batch mode, i.e., executing multiple changes in one call. hitchcockwidgetmodel.lib
Since
S60 ?S60_version Draft

Constructor & Destructor Documentation

AlfModelOperation(OperationType, int, int *, IAlfVariantType *)

AlfModelOperation(OperationTypeaOperation,
intaNumContainerIndices,
int *aContainerIndices,
IAlfVariantType *aData = 0
)[private]

Parameters

OperationType aOperation
int aNumContainerIndices
int * aContainerIndices
IAlfVariantType * aData = 0

AlfModelOperation(OperationType, int, int *, IAlfVariantType *, const UString &)

AlfModelOperation(OperationTypeaOperation,
intaNumContainerIndices,
int *aContainerIndices,
IAlfVariantType *aData,
const UString &aDataName
)[private]

Parameters

OperationType aOperation
int aNumContainerIndices
int * aContainerIndices
IAlfVariantType * aData
const UString & aDataName

~AlfModelOperation()

OSN_IMPORT~AlfModelOperation()

Destructor.

Member Functions Documentation

containerIndex(int)

OSN_IMPORT intcontainerIndex(intaIndex)const

Get the container index to traverse through the data hierarchy. If the container in the hierarchy is a branch, index 0 refers to the branch data, and index 1 refers to the child data.

Since
S60 ?S60_version

Parameters

int aIndex

create(OperationType, int, int *, IAlfVariantType *)

OSN_IMPORT AlfModelOperation *create(OperationTypeaOperation,
intaNumContainerIndices,
int *aContainerIndices,
IAlfVariantType *aData = 0
)[static]

constructor. The new operation is left on the cleanup stack.

Exceptions
std::bad_alloc

Since
S60 ?S60_version

Parameters

OperationType aOperationThe operation to be performed.
int aNumContainerIndicesThe number of indices in aContainerIndices.
int * aContainerIndicesThe container indices to find the correct location in the data hierarchy. The ownership is transferred.
IAlfVariantType * aData = 0The new data in EOperationAdd and EOperationUpdate operations. The ownership is transferred.

create(OperationType, int, int *, IAlfVariantType *, const UString &)

OSN_IMPORT AlfModelOperation *create(OperationTypeaOperation,
intaNumContainerIndices,
int *aContainerIndices,
IAlfVariantType *aData,
const UString &aDataName
)[static]

constructor for adding or updating a map item. The new operation is left on the cleanup stack.

Exceptions
std::bad_alloc

Since
S60 ?S60_version

Parameters

OperationType aOperationThe operation to be performed.
int aNumContainerIndicesThe number of indices in aContainerIndices.
int * aContainerIndicesThe container indices to find the correct location in the data hierarchy. The ownership is transferred.
IAlfVariantType * aDataThe new data. The ownership is transferred.
const UString & aDataNameThe name of the new data in EOperationAdd and EOperationUpdate operations. Only needed when adding or updating a map item.

getNewData()

OSN_IMPORT IAlfVariantType *getNewData()

Get the new data used in EOperationAdd or EOperationUpdate operations. Panics if the operation is EOperationRemove. The ownership of the data is transferred to the caller, and the data of this operation is set to NULL.

Exceptions
osncore::AlfDataException

Thrown with the error code osncore::EInvalidModelOperation when wrong operation is performed on Model.

Since
S60 ?S60_version

index()

OSN_IMPORT intindex()const

Get the index of the data inside the parent container. The parent container can be queried using ParentData(). If the parent container is a branch, index 0 refers to the branch data, and index 1 refers to the child data.

Since
S60 ?S60_version

newData()

OSN_IMPORT IAlfVariantType &newData()const

Get the new data used in EOperationAdd or EOperationUpdate operations. Panics if the operation is EOperationRemove.

Exceptions
osncore::AlfDataException

Thrown with the error code osncore::EInvalidModelOperation when wrong operation is performed on Model.

Since
S60 ?S60_version

newDataName()

OSN_IMPORT const UString &newDataName()const

Get the name of the new data field in the container map. Panics if the operation is EOperationRemove.

Exceptions
osncore::AlfDataException

Thrown with the error code osncore::EInvalidModelOperation when wrong operation is performed on Model.

Since
S60 ?S60_version

numContainerIndices()

OSN_IMPORT intnumContainerIndices()const

Get the number of container indices to find the location in the data hierarchy.

Since
S60 ?S60_version

operation()

OSN_IMPORT AlfModelOperation::OperationTypeoperation()const

Get the Operation.

Since
S60 ?S60_version

parentData(IAlfVariantType &)

OSN_IMPORT IAlfVariantType *parentData(IAlfVariantType &aRoot)const

Get the parent data for the operation. The parent data is a container for the data to be added, removed or updated. The index of the data can be queried using Index().

Exceptions
osncore::AlfDataException

Thrown with the error code osncore::EInvalidContainerOperation when wrong operation is performed on Model.

Since
S60 ?S60_version

Parameters

IAlfVariantType & aRootThe root of the data hierarchy to perform the operation.

Member Enumerations Documentation

Enum OperationType

The operation constants.

Enumerators

EOperationAdd
EOperationRemove
EOperationUpdate

Member Data Documentation

int * mContainerIndices

int *mContainerIndices[private]

IAlfVariantType * mData

IAlfVariantType *mData[private]

UString mDataName

UString mDataName[private]

int mNumContainerIndices

intmNumContainerIndices[private]

OperationType mOperation

OperationType mOperation[private]