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 *)

void ConstructL ( MContextInitializationObserver * aObserver ) [private]

2nd phase construction, called by GetInstance()

Parameters

MContextInitializationObserver * aObserver object/callback to notify when initialization is ready.

ContextSnapshot(MContextSnapshotObserver &, CHarvesterData &)

IMPORT_C void ContextSnapshot ( MContextSnapshotObserver & aObserver,
CHarvesterData & aHD
)

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

Parameters

MContextSnapshotObserver & aObserver an interface class for callback.
CHarvesterData & aHD

ContextSnapshot(MContextSnapshotObserver &, RPointerArray< CHarvesterData > &)

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

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

Parameters

MContextSnapshotObserver & aObserver an interface class for callback.
RPointerArray < CHarvesterData > & aMetadataObjectArray An array of MdE objects the snapshot is taken to.

ContextSnapshotStatus(CHarvesterData *)

void ContextSnapshotStatus ( 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 void Destroy ( )

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 = NULL an interface class for callback or NULL

PluginCount()

IMPORT_C TInt PluginCount ( )

Method used to clarify amount of plug-ins.

QueueSnapshotItem(CContextSnapshotItem *)

void QueueSnapshotItem ( 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 * aItem An item to add.

ReleaseInstance()

IMPORT_C void ReleaseInstance ( )

Release an instance of this singleton.

SetMdeSession(CMdESession *)

IMPORT_C void SetMdeSession ( 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 * aSession Session 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.