|
S60 3rd Edition SDK for Symbian OS Example Applications Guide |
#include <LandmarksDbEventHandler.h>
Public Member Functions | |
| CLandmarksDbEventHandler (CPosLandmarkDatabase &aDb) | |
| ~CLandmarksDbEventHandler () | |
| void | AddObserverL (MLandmarksDbObserver *aObserver) |
Protected Member Functions | |
| void | RunL () |
| void | DoCancel () |
| TInt | RunError (TInt aError) |
Private Member Functions | |
| void | ObserveEvents () |
Private Attributes | |
| CPosLandmarkDatabase & | iDb |
| The database to observe. | |
| TPosLmEvent | iEvent |
| A db event to be reported. | |
| RPointerArray< MLandmarksDbObserver > | iDbObservers |
| An array of registered observers. | |
Definition at line 37 of file LandmarksDbEventHandler.h.
|
|
C++ constructor.
Definition at line 29 of file LandmarksDbEventHandler.cpp. References ObserveEvents(). 00031 : CActive(CActive::EPriorityStandard), iDb(aDb) 00032 { 00033 CActiveScheduler::Add(this); 00034 ObserveEvents(); 00035 }
|
|
|
Destructor. Definition at line 38 of file LandmarksDbEventHandler.cpp. References iDbObservers. 00039 { 00040 Cancel(); 00041 iDbObservers.Close(); 00042 }
|
|
|
AddObserverL registers a db observer.
Definition at line 50 of file LandmarksDbEventHandler.cpp. References iDbObservers. 00052 { 00053 User::LeaveIfError(iDbObservers.Append(aObserver)); 00054 }
|
|
|
Handles an active object’s request completion event. Definition at line 62 of file LandmarksDbEventHandler.cpp. References iDbObservers, and iEvent. 00063 { 00064 for (TInt i = 0; i < iDbObservers.Count(); i++) 00065 { 00066 // All observers must be notified. We cannot allow the observers to 00067 // leave. 00068 TInt err; 00069 TRAP(err, iDbObservers[i]->NotifyDbEventL(iEvent, iStatus.Int())); 00070 } 00071 ObserveEvents(); 00072 }
|
|
|
Implements cancellation of an outstanding request. Definition at line 80 of file LandmarksDbEventHandler.cpp. References iDb. 00081 { 00082 iDb.CancelNotifyDatabaseEvent(); 00083 }
|
|
|
Handles a leave occurring in the request completion event handler RunL().
Definition at line 91 of file LandmarksDbEventHandler.cpp.
|
|
|
Starts observing of db enevs Definition at line 102 of file LandmarksDbEventHandler.cpp. 00103 { 00104 iStatus = KRequestPending; 00105 iDb.NotifyDatabaseEvent(iEvent, iStatus); 00106 SetActive(); 00107 }
|
|
© Nokia 2006 |