CLbsSuplPushImpl Class Reference

class CLbsSuplPushImpl : public CActive

The class provides an internal implementation of the functionality exposed by the CLbsSuplPush interface.

CLbsSuplPush MLbsSuplPushObserver

Inherits from

Public Member Functions
~CLbsSuplPushImpl ()
CLbsSuplPushImpl * NewL ( TLbsSuplPushChannel , MLbsSuplPushObserver &)
TInt OnTimerError ( TInt , TInt )
void OnTimerEventL ( TInt )
TInt SuplInit ( TLbsSuplPushRequestId &, const TDesC8 &, TInt )
Protected Member Functions
void DoCancel ()
void RunL ()
Private Member Functions
CLbsSuplPushImpl ( TLbsSuplPushChannel , MLbsSuplPushObserver &)
void ConstructL ( TLbsSuplPushChannel )
TInt GetBusyData ( TBool &, TInt &)
TInt ReleaseBusyProp ()
TInt SendMessage ( TBool )
TInt SetBusyData ( TBool , TInt )
void SuplInitL ( TLbsSuplPushRequestId &, const TDesC8 &)
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::RunError(TInt)
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enum TState { ECreated  = 1, EInitialized  = 2, EWaitingAck  = 4, EWaitingBusy  = 8 }
Inherited Enumerations
CActive:TPriority
Private Attributes
TUint iAckPropKey
RProperty iAckProperty
TUint iBusyPropKey
RProperty iBusyProperty
TLbsSuplPushChannel iChannel
TUint iInitPropKey
RPointerArray < CLbsSuplPushMsgInfo > iMsgQueue
MLbsSuplPushObserver & iObserver
TUid iPropOwnerSecureId
TState iState
CLbsCallbackTimer * iTimer
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CLbsSuplPushImpl(TLbsSuplPushChannel, MLbsSuplPushObserver &)

CLbsSuplPushImpl ( TLbsSuplPushChannel aChannel,
MLbsSuplPushObserver & aObserver
) [private]

Constructor.

Parameters

TLbsSuplPushChannel aChannel [In] The id of the channel to be opened.
MLbsSuplPushObserver & aObserver [In] A reference to an observer waiting for request completion call-backs.

~CLbsSuplPushImpl()

~CLbsSuplPushImpl ( ) [virtual]

Closes the interface and disposes all open or used resources.

Member Functions Documentation

ConstructL(TLbsSuplPushChannel)

void ConstructL ( TLbsSuplPushChannel aChannel ) [private]

2nd phase constructor. Creates and assigns all the required internal resources.

Parameters

TLbsSuplPushChannel aChannel [In] An id of the channel to be opened.

DoCancel()

void DoCancel ( ) [protected, virtual]

Called when CActive::Cancel method is called. It cancels both the ACK and BUSY subscriptions. Only one of the two subscriptions can be actually active at every moment. But it is harmless to cancel inactive subscription.

CActive::DoCancel CLbsSuplPushImpl::~CLbsSuplPushImpl CLbsSuplPushImpl::SendMessage CLbsSuplPushImpl::OnTimerEventL

GetBusyData(TBool &, TInt &)

TInt GetBusyData ( TBool & aBusy,
TInt & aNextReqId
) const [private]

Reads the busy flag and the next free request id from the BUSY property.

CLbsSuplPushImpl::SuplInitL CLbsSuplPushImpl::SendMessage CLbsSuplPushImpl::ReleaseBusyProp

Parameters

TBool & aBusy [Out] The busy flag.
TInt & aNextReqId

NewL(TLbsSuplPushChannel, MLbsSuplPushObserver &)

CLbsSuplPushImpl * NewL ( TLbsSuplPushChannel aChannel,
MLbsSuplPushObserver & aObserver
) [static]

Creates an instance of the CLbsSuplPushImpl class.

CLbsSuplPush::ConstructL

Parameters

TLbsSuplPushChannel aChannel [In] The id of the channel to be opened.
MLbsSuplPushObserver & aObserver [In] A reference to an observer waiting for request completion call-backs.

OnTimerError(TInt, TInt)

TInt OnTimerError ( TInt aTimerId,
TInt aError
) [virtual]

From MLbsCallbackTimerObserver . Normally it is called when OnTimerEventL leaves. Our implementation of OnTimerEventL does not leave, so this function must not be called.

MLbsCallbackTimerObserver CLbsCallbackTimer

Parameters

TInt aTimerId
TInt aError

OnTimerEventL(TInt)

void OnTimerEventL ( TInt aTimerId ) [virtual]

From MLbsCallbackTimerObserver . Called when a message timeout error happens. It removes the outdated message from the queue, notifies the observer that that message fails. Then it tries to deliver the next message if there is any. If there is no messages to deliver and the object is in the EWaitingBusy state, it unsubscribes from the BUSY property.

CLbsCallbackTimer CLbsSuplPushImpl::OnTimerError

Parameters

TInt aTimerId

ReleaseBusyProp()

TInt ReleaseBusyProp ( ) [private]

Tries to release the BUSY property. Switches to the EInitialized state in any case even though a error happens.

CLbsSuplPushImpl::~CLbsSuplPushImpl CLbsSuplPushImpl::OnTimerEventL CLbsSuplPushImpl::RunL

RunL()

void RunL ( ) [protected, virtual]

Called either when in the EWaitingAck state and the ACK property is changed or when in the EWaitingBusy state and the BUSY property is changed.

In the EWaitingAck state it checks that it is really the notification on the message delivering now. If it is, it notifies the observer about the successful delivery. If not, it resubscribes, returns immediately and the object continues to wait for the correct notification asynchronously.

In the EWaitingBusy state it checks if the channel is free. If it is not, it resubscribes, returns immideatelly, and the object continues to wait when the channel is free asynchronously.

In both states if the object is in the EInitialized state and ready to deliver the next message, the function tries to deliver the message if there is any.

leave
The function does not leave despite it has the L suffix. So, we do not need to imlement the CActive::RunError function.
CActive::RunL

SendMessage(TBool)

TInt SendMessage ( TBool aNotifyObserver ) [private]

Tries to send the next message in the queue. If the channel is busy, it subscribes for the BUSY property and wait asynchronously when the property is free.

CLbsSuplPushImpl::SuplInitL CLbsSuplPushImpl::OnTimerEventL CLbsSuplPushImpl::RunL

Parameters

TBool aNotifyObserver [In] If the function must notify the observer when a error happens and the message fails.

SetBusyData(TBool, TInt)

TInt SetBusyData ( TBool aBusy,
TInt aNextReqId
) const [private]

Writes the busy flag and the next free request id from the BUSY property.

CLbsSuplPushImpl::SuplInitL CLbsSuplPushImpl::SendMessage CLbsSuplPushImpl::ReleaseBusyProp

Parameters

TBool aBusy [In] The busy flag.
TInt aNextReqId

SuplInit(TLbsSuplPushRequestId &, const TDesC8 &, TInt)

TInt SuplInit ( TLbsSuplPushRequestId & aReqId,
const TDesC8 & aMsg,
TInt aReserved
)

Parameters

TLbsSuplPushRequestId & aReqId [Out] A reference on the TLbsSuplPushRequestId variable where the assigned request id is written.
const TDesC8 & aMsg [In] The message buffer.
TInt aReserved [In] Reserved for future use.

SuplInitL(TLbsSuplPushRequestId &, const TDesC8 &)

void SuplInitL ( TLbsSuplPushRequestId & aReqId,
const TDesC8 & aMsg
) [private]

A leaving implementation of the CLbsSuplPushImpl::SuplInit .

leave
If a error happens, it leaves with the correspondent error code.
CLbsSuplPushImpl::SuplInit

Parameters

TLbsSuplPushRequestId & aReqId [Out] A reference on the TLbsSuplPushRequestId variable where the assigned request id is written.
const TDesC8 & aMsg [In] The message buffer.

Member Enumerations Documentation

Enum TState

The set of the states the class can be

CLbsSuplPushImpl::CheckStateL

Enumerators

ECreated = 1

The initial state the object gets to after creation

EInitialized = 2

The state after the object got the P&S category UID and attached to the BUSY and ACK props In that state there may be from zero to several messages in the queue. The INIT property has never been set for any of the messages in the queue. The BUSY property has not been set to ETrue by this object as well.

EWaitingAck = 4

The state after the object has tried to deliver a message, has set successfully the INIT property, subscribed for the ACK property and is waiting for the ACK property to be set.

EWaitingBusy = 8

The state after the object checked that the BUSY property is set to ETrue by another plug-in, subscribed for the BUSY property and is waiting for the BUSY property to be set to EFalse.

Member Data Documentation

TUint iAckPropKey

TUint iAckPropKey [private]

The ACK property key

RProperty iAckProperty

RProperty iAckProperty [private]

An ACK property handle

TUint iBusyPropKey

TUint iBusyPropKey [private]

The BUSY property key

RProperty iBusyProperty

RProperty iBusyProperty [private]

A BUSY property handle

TLbsSuplPushChannel iChannel

TLbsSuplPushChannel iChannel [private]

The id of the channel used

TUint iInitPropKey

TUint iInitPropKey [private]

The INIT property key

RPointerArray< CLbsSuplPushMsgInfo > iMsgQueue

RPointerArray < CLbsSuplPushMsgInfo > iMsgQueue [private]

The message queue

MLbsSuplPushObserver & iObserver

MLbsSuplPushObserver & iObserver [private]

A reference to a user of the CLbsSuplPushImpl interface waiting for request completion call-backs.

TUid iPropOwnerSecureId

TUid iPropOwnerSecureId [private]

The security id of the process that defines the P&S props used

TState iState

TState iState [private]

The state of the CLbsSuplPushImpl object

CLbsCallbackTimer * iTimer

CLbsCallbackTimer * iTimer [private]

The message timeout timer