CContextEngine Class Reference

class CContextEngine : public CBase

An engine to collect context metadata with available context plugins. CContextEngineAO is used to do the actual work. This class is implemented as a Singleton.

Inherits from

Constructor & Destructor Documentation

CContextEngine()

CContextEngine()[private]

C++ constructor - not exported; implicitly called from GetInstance()

~CContextEngine()

~CContextEngine()[virtual]

Destroys the implementation. This is virtual method and this class is not intended for derivation, so not exported.

Member Functions Documentation

ConstructL(MContextInitializationObserver *)

voidConstructL(MContextInitializationObserver *aObserver)[private]

2nd phase construction, called by GetInstance()

Parameters

MContextInitializationObserver * aObserverobject/callback to notify when initialization is ready.

ContextSnapshot(MContextSnapshotObserver &, CHarvesterData &)

IMPORT_C voidContextSnapshot(MContextSnapshotObserver &aObserver,
CHarvesterData &aHD
)

Context snapshot. This takes the snapshot using plug-ins.

Parameters

MContextSnapshotObserver & aObserveran interface class for callback.
CHarvesterData & aHD

ContextSnapshot(MContextSnapshotObserver &, RPointerArray< CHarvesterData > &)

IMPORT_C voidContextSnapshot(MContextSnapshotObserver &aObserver,
RPointerArray< CHarvesterData > &aMetadataObjectArray
)

Context snapshot. This takes the snapshot using plug-ins.

Parameters

MContextSnapshotObserver & aObserveran interface class for callback.
RPointerArray< CHarvesterData > & aMetadataObjectArrayAn array of MdE objects the snapshot is taken to.

ContextSnapshotStatus(CHarvesterData *)

voidContextSnapshotStatus(CHarvesterData *aHD)

From MContextEngineObserver. Method is called by CContextEngineAO when a context snapshot is finished or an error has occured.

Parameters

CHarvesterData * aHD

Destroy()

IMPORT_C voidDestroy()

Ignores the reference count and destroys this singleton. THINK BEFORE USING! Should be used only instead of reference counting if clients are not calling ReleaseInstance() (which they should).

GetInstanceL(MContextInitializationObserver *)

IMPORT_C CContextEngine *GetInstanceL(MContextInitializationObserver *aObserver = NULL)[static]

Gets an instance to CContextEngine singleton. A new object is created if needed. If an observer object to notify is given, context plugins are initialized asyncronously and observer is notified when ready.

Parameters

MContextInitializationObserver * aObserver = NULLan interface class for callback or NULL

PluginCount()

IMPORT_C TIntPluginCount()

Method used to clarify amount of plug-ins.

QueueSnapshotItem(CContextSnapshotItem *)

voidQueueSnapshotItem(CContextSnapshotItem *aItem)[private]

Add a new observer and metadata items to a queue. These observers need to be informed when a snapshot is ready and items need a context snapshot.

Parameters

CContextSnapshotItem * aItemAn item to add.

ReleaseInstance()

IMPORT_C voidReleaseInstance()

Release an instance of this singleton.

SetMdeSession(CMdESession *)

IMPORT_C voidSetMdeSession(CMdESession *aSession)

Set a pointer to MdESession. The pointer is given forward to context plugins. Session must be set in order to successfully harvest context data.

Parameters

CMdESession * aSessionSession pointer to set.

Member Data Documentation

TInt iArrayCount

TInt iArrayCount[private]

In case array of objects for snapshot were passed, variable to store the amount of items to be processed.

CContextEngineAO * iContextEngineAO

CContextEngineAO *iContextEngineAO[private]

This active object is used to handle queued snapshot requests.

TInt iProcessedArrayCount

TInt iProcessedArrayCount[private]

In case array of objects for snapshot were passed, variable to store the amount of items that have been processed.

RPointerArray< CContextSnapshotItem > iSnapshotQueue

RPointerArray< CContextSnapshotItem >iSnapshotQueue[private]

Array of observers and related metadata objects that need a context snapshot. Related observer is informed about snapshot completion.