CSensrvChannelListener Class Reference

class CSensrvChannelListener : public CBase

Implements channel listener related handling.

Since
S60 5.0

Inherits from

Public Member Functions
~CSensrvChannelListener ()
TInt DesiredBufferingCount ()
void DispatchMessage ( CSensrvMessage &)
void HandleNextProperty ()
void HandleSetPropertySuccessInd (const TPropertySetSuccessEvaluationData &)
TInt MaximumBufferingCount ()
TInt NewDataAvailable ()
CSensrvChannelListener * NewL ( CSensrvSession &, CSensrvChannel &, CSensrvPluginProxy &)
TInt Priority ()
TInt ReadPriority ()
TInt RemainingBufferingCount ()
CSensrvSession & Session ()
TInt StartListening ( TInt , TInt , TInt , TSensrvChannelListenerState )
TInt State ()
void StopListening ( TSensrvChannelListenerState , TBool )
TInt StoreChangedProperty (const TSensrvProperty &)
void TimerFired ( TInt )
Private Member Functions
CSensrvChannelListener ( CSensrvSession &, CSensrvChannel &, CSensrvPluginProxy &)
void ClearConditionQueues ()
void CompleteConditionMessageD (CSensrvChannelConditionSetImpl &)
void CompleteSetPropertySuccessInd ()
void ConstructL ()
void EvaluateConditionsForNewData ()
TSetPropertySuccessIndicator EvaluatePriorities (const TPropertySetSuccessEvaluationData &)
TInt SetMessageData ( TChannelDataMessage &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
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 TSensrvChannelListenerState { EChannelListenerStateInactive  = 0, EChannelListenerStateConditionListening  = 1, EChannelListenerStateDataListening  = 2, EChannelListenerStatePropertyListening  = 4 }
Private Attributes
TSglQueIter < CSensrvChannelConditionSetImpl > iAddedConditionSetIter
TSglQue < CSensrvChannelConditionSetImpl > iAddedConditionSetList
TTimeIntervalMicroSeconds32 iBufferingPeriod
TBool iBufferingPeriodExpired
CSensrvTimer * iBufferingPeriodTimer
CSensrvChannel & iChannel
CSensrvMessage * iClientConditionMessage
CSensrvMessage * iClientDataMessage
CSensrvMessage * iClientPropertyMessage
CSensrvConditionEvaluator * iConditionEvaluator
TInt iDesiredBufferingCount
TBool iInitialDataSent
TInt iMaximumBufferingCount
TSglQueIter < CSensrvChannelConditionSetImpl > iMetConditionSetIter
TSglQue < CSensrvChannelConditionSetImpl > iMetConditionSetList
TInt iPriority
CSensrvPluginProxy & iProxy
CSensrvSession & iSession
TSetPropertySuccessIndicator iSetPropertySuccessInd
TBool iSetPropertySuccessIndPending
TInt iState
TSensrvTailIndexItem * iTailItem
CSensrvPropertyQueue * iUnnotifiedProperties

Constructor & Destructor Documentation

CSensrvChannelListener(CSensrvSession &, CSensrvChannel &, CSensrvPluginProxy &)

CSensrvChannelListener ( CSensrvSession & aSession,
CSensrvChannel & aChannel,
CSensrvPluginProxy & aProxy
) [private]

C++ constructor

Since
S60 5.0

Parameters

CSensrvSession & aSession Related client session.
CSensrvChannel & aChannel Parent channel.
CSensrvPluginProxy & aProxy Plugin proxy.

~CSensrvChannelListener()

~CSensrvChannelListener ( ) [virtual]

Destructor.

Member Functions Documentation

ClearConditionQueues()

void ClearConditionQueues ( ) [private]

Clears condition queues.

Since
S60 5.0

CompleteConditionMessageD(CSensrvChannelConditionSetImpl &)

void CompleteConditionMessageD ( CSensrvChannelConditionSetImpl & aSet ) [private]

Completes asynchronous condition message. Message must exist.

Since
S60 5.0

Parameters

CSensrvChannelConditionSetImpl & aSet Set that was met. There must be met data in this set. The set is removed from met sets list and deleted if completion of message is successful. Otherwise the set remains in the list.

CompleteSetPropertySuccessInd()

void CompleteSetPropertySuccessInd ( ) [private]

Completes the property set success notification to client.

Since
S60 5.0

ConstructL()

void ConstructL ( ) [private]

2nd phase of construction

Since
S60 5.0

DesiredBufferingCount()

TInt DesiredBufferingCount ( ) const [inline]

Gets listener desired buffering count.

Since
S60 5.0

DispatchMessage(CSensrvMessage &)

void DispatchMessage ( CSensrvMessage & aMessage )

Handles client message. Message completion responsibility transfers. Called only within server thread.

Since
S60 5.0

Parameters

CSensrvMessage & aMessage The message containing the client request.

EvaluateConditionsForNewData()

void EvaluateConditionsForNewData ( ) [private]

Evaluates conditions for new data.

Since
S60 5.0

EvaluatePriorities(const TPropertySetSuccessEvaluationData &)

TSetPropertySuccessIndicator EvaluatePriorities ( const TPropertySetSuccessEvaluationData & aEvaluationData ) [private]

Handles the property set success status logic

Since
S60 5.0

Parameters

const TPropertySetSuccessEvaluationData & aEvaluationData The evaluation data for the indication logic.

HandleNextProperty()

void HandleNextProperty ( )

Notifies client about any changed properties in property queue.

Since
S60 5.0

HandleSetPropertySuccessInd(const TPropertySetSuccessEvaluationData &)

void HandleSetPropertySuccessInd ( const TPropertySetSuccessEvaluationData & aEvaluationData )

Handles the property set success status update and client notification

Since
S60 5.0

Parameters

const TPropertySetSuccessEvaluationData & aEvaluationData The evaluation data for the indication logic.

MaximumBufferingCount()

TInt MaximumBufferingCount ( ) const [inline]

Gets listener maximum buffering count.

Since
S60 5.0

NewDataAvailable()

TInt NewDataAvailable ( )

Notifies listener that there is new data available in buffer.

Since
S60 5.0

NewL(CSensrvSession &, CSensrvChannel &, CSensrvPluginProxy &)

CSensrvChannelListener * NewL ( CSensrvSession & aSession,
CSensrvChannel & aChannel,
CSensrvPluginProxy & aProxy
) [static]

Two phase constructor

Since
S60 5.0
Exceptions
KErrNoMemory

Out of memory

Parameters

CSensrvSession & aSession Related client session.
CSensrvChannel & aChannel Parent channel.
CSensrvPluginProxy & aProxy Plugin proxy.

Priority()

TInt Priority ( )

Get the priority of the client process which this listener is serving.

Since
S60 5.0

ReadPriority()

TInt ReadPriority ( )

Read the priority of the process which this listener is serving from cenrep.

Since
S60 5.0

RemainingBufferingCount()

TInt RemainingBufferingCount ( )

Gets the remaining buffering count still required to fill data request from client.

Since
S60 5.0

Session()

CSensrvSession & Session ( ) const [inline]

Gets session related to this listener.

Since
S60 5.0

SetMessageData(TChannelDataMessage &)

TInt SetMessageData ( TChannelDataMessage & aData ) [private]

Sets data to message to be returned to client.

Since
S60 5.0

Parameters

TChannelDataMessage & aData Data to set to the message.

StartListening(TInt, TInt, TInt, TSensrvChannelListenerState)

TInt StartListening ( TInt aDesiredBufferingCount,
TInt aMaximumBufferingCount,
TInt aBufferingPeriod,
TSensrvChannelListenerState aState
)

Starts listening actively for data and/or conditions. Buffering period and buffering count are same for both condition and data listening. If listener is doing both, lower values for each are used.

Since
S60 5.0

Parameters

TInt aDesiredBufferingCount
TInt aMaximumBufferingCount
TInt aBufferingPeriod
TSensrvChannelListenerState aState Indicates if starting listening for data or (EChannelListenerStateDataListening) or conditions (EChannelListenerStateConditionListening).

State()

TInt State ( ) const [inline]

Gets listener state.

Since
S60 5.0

StopListening(TSensrvChannelListenerState, TBool)

void StopListening ( TSensrvChannelListenerState aState,
TBool aDeleteConditions
)

Stops listening actively for data and/or conditions.

Since
S60 5.0

Parameters

TSensrvChannelListenerState aState Indicates if stopping listening for data or (EChannelListenerStateDataListening) or conditions (EChannelListenerStateConditionListening).
TBool aDeleteConditions If ETrue, indicates that any added conditions should also be deleted. This is only evaluated if aState is EChannelListenerStateConditionListening.

StoreChangedProperty(const TSensrvProperty &)

TInt StoreChangedProperty ( const TSensrvProperty & aProperty )

Stores changed property to the property queue. Called from SSY thread only.

Since
S60 5.0

Parameters

const TSensrvProperty & aProperty

TimerFired(TInt)

void TimerFired ( TInt aTimerId )

Called when the timer fires

Since
S60 5.0

Parameters

TInt aTimerId Timer identifier to id which timer fired.

Member Enumerations Documentation

Enum TSensrvChannelListenerState

Channel listener state. State is a bitmask, as listener may be listening for both conditions and data simultaneously. EChannelListenerStateInactive state is an exception, and it may not be masked with other states.

Enumerators

EChannelListenerStateInactive = 0
EChannelListenerStateConditionListening = 1
EChannelListenerStateDataListening = 2
EChannelListenerStatePropertyListening = 4

Member Data Documentation

TSglQueIter< CSensrvChannelConditionSetImpl > iAddedConditionSetIter

TSglQueIter < CSensrvChannelConditionSetImpl > iAddedConditionSetIter [private]

Iterator for condition list

TSglQue< CSensrvChannelConditionSetImpl > iAddedConditionSetList

TSglQue < CSensrvChannelConditionSetImpl > iAddedConditionSetList [private]

List of added condition sets Sets in list owned.

TTimeIntervalMicroSeconds32 iBufferingPeriod

TTimeIntervalMicroSeconds32 iBufferingPeriod [private]

Listener desired buffering period, in microseconds.

TBool iBufferingPeriodExpired

TBool iBufferingPeriodExpired [private]

Indicates buffering period has expired, so any amount of data is enough.

CSensrvTimer * iBufferingPeriodTimer

CSensrvTimer * iBufferingPeriodTimer [private]

Buffering period timer Own.

CSensrvChannel & iChannel

CSensrvChannel & iChannel [private]

Parent channel.

CSensrvMessage * iClientConditionMessage

CSensrvMessage * iClientConditionMessage [private]

Pending message for sending condition met notifications to client Not own.

CSensrvMessage * iClientDataMessage

CSensrvMessage * iClientDataMessage [private]

Pending message for sending data to client Not own.

CSensrvMessage * iClientPropertyMessage

CSensrvMessage * iClientPropertyMessage [private]

Pending message for sending changed property data to client Not own.

CSensrvConditionEvaluator * iConditionEvaluator

CSensrvConditionEvaluator * iConditionEvaluator [private]

Condition evaluator. Not own.

TInt iDesiredBufferingCount

TInt iDesiredBufferingCount [private]

Listener desired buffering count

TBool iInitialDataSent

TBool iInitialDataSent [private]

Indicates if initial data has been sent

TInt iMaximumBufferingCount

TInt iMaximumBufferingCount [private]

Listener maximum buffering count

TSglQueIter< CSensrvChannelConditionSetImpl > iMetConditionSetIter

TSglQueIter < CSensrvChannelConditionSetImpl > iMetConditionSetIter [private]

Iterator for condition list

TSglQue< CSensrvChannelConditionSetImpl > iMetConditionSetList

TSglQue < CSensrvChannelConditionSetImpl > iMetConditionSetList [private]

List of met condition sets that are not yet notified. Sets in list owned.

TInt iPriority

TInt iPriority [private]

Priority of the client process. KErrUnknown means that the priority is not yet fetched from CentralRepository.

CSensrvPluginProxy & iProxy

CSensrvPluginProxy & iProxy [private]

Callback proxy

CSensrvSession & iSession

CSensrvSession & iSession [private]

Related client session.

TSetPropertySuccessIndicator iSetPropertySuccessInd

TSetPropertySuccessIndicator iSetPropertySuccessInd [private]

The current status of property set success indicator

TBool iSetPropertySuccessIndPending

TBool iSetPropertySuccessIndPending [private]

Indicates pending property set success notification

TInt iState

TInt iState [private]

Current channel listener state

TSensrvTailIndexItem * iTailItem

TSensrvTailIndexItem * iTailItem [private]

Tail index item. Not own, owned by channel buffer

CSensrvPropertyQueue * iUnnotifiedProperties

CSensrvPropertyQueue * iUnnotifiedProperties [private]

Stores changed properties informed by channel until they can be handled.