os/persistentdata/loggingservices/eventlogger/LogServ/inc/LogServDatabaseChangeTracker.h
Update contrib.
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __LOGSERVDATABASECHANGETRACKER_H__
17 #define __LOGSERVDATABASECHANGETRACKER_H__
20 #include "LogServBackupObserver.h"
21 #include "LogServDatabaseChangeInterface.h"
22 #include "LogServDatabaseChangeDefinition.h"
25 class CLogChangeDefinition;
26 class MLogServBackupInterface;
27 class MLogServDatabaseTransactionInterface;
30 /////////////////////////////////////////////////////////////////////////////////////////
31 // -----> CLogServDatabaseChangeTracker (header)
32 /////////////////////////////////////////////////////////////////////////////////////////
36 class CLogServDatabaseChangeTracker : public CActive, public MLogServBackupObserver, public MLogServDatabaseChangeInterface
38 /////////////////////////////////////////////////////////////////////////////////////////
40 /////////////////////////////////////////////////////////////////////////////////////////
41 static CLogServDatabaseChangeTracker* NewL(MLogServDatabaseTransactionInterface& aDatabase, MLogServBackupInterface& aBackupInterface, TInt aPriority);
42 ~CLogServDatabaseChangeTracker();
44 /////////////////////////////////////////////////////////////////////////////////////////
45 private: // INTERNAL CONSTRUCT
46 /////////////////////////////////////////////////////////////////////////////////////////
47 CLogServDatabaseChangeTracker(MLogServDatabaseTransactionInterface& aDatabase, MLogServBackupInterface& aBackupInterface, TInt aPriority);
50 /////////////////////////////////////////////////////////////////////////////////////////
51 private: // FROM MLogServDatabaseChangeInterface
52 /////////////////////////////////////////////////////////////////////////////////////////
53 void DCISubmitChangedEventContextL(TLogDatabaseChangeType aType, TLogId aEventId);
54 void DCISubmitGlobalChangeContextL(TUid aChangeType, TInt aContextParam1, TInt aContextParam2, TInt aContextParam3);
56 void DCIRequestChangeNotificationsL(MLogServDatabaseChangeObserver& aObserver);
57 void DCIRequestChangeNotificationsCancel(MLogServDatabaseChangeObserver& aObserver);
59 /////////////////////////////////////////////////////////////////////////////////////////
60 private: // FROM MLogServBackupObserver
61 /////////////////////////////////////////////////////////////////////////////////////////
62 void BOHandleEventL(TLogServBackupEvent aEvent);
64 /////////////////////////////////////////////////////////////////////////////////////////
65 private: // FROM CActive
66 /////////////////////////////////////////////////////////////////////////////////////////
69 TInt RunError(TInt aError);
71 /////////////////////////////////////////////////////////////////////////////////////////
72 private: // INTERNAL METHODS
73 /////////////////////////////////////////////////////////////////////////////////////////
75 void NotifyObserversL();
76 void NotifyGlobalChangeEventsL();
77 static TBool IdleNotifyGlobalChangeEvents(TAny* aSelf);
79 /////////////////////////////////////////////////////////////////////////////////////////
80 private: // MEMBER DATA
81 /////////////////////////////////////////////////////////////////////////////////////////
84 * Watches the database for change events
86 MLogServDatabaseTransactionInterface& iDatabase;
89 * Watches the database for change events
91 MLogServBackupInterface& iBackupInterface;
94 * Watches the database for change events
96 RDbNotifier iNotifier;
101 RPointerArray<MLogServDatabaseChangeObserver> iObservers;
106 CLogChangeDefinition* iChanges;
109 * Used to ensure any global changes are pushed to clients
110 * only after all other active object operations are complete.
115 * A queue of global change events
117 RArray<TLogServDatabaseChangeDefinition> iGlobalChanges;