First public contribution.
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 __LOGSERVCACHECONFIG_H__
17 #define __LOGSERVCACHECONFIG_H__
22 class MLogServDatabaseTransactionInterface;
25 Caches a copy of the LogEng configuration data (a TLogConfig instance).
26 Provides public methods for retrieving/updating the configuration data.
27 if the configuration data is updated in a transaction, the changes will be committed/rolled back
28 when the transaction is committed/rolled back.
30 Note: the LogEng configuration is kept in a database table with name "Config".
33 @see MLogServDatabaseTransactionInterface
36 class CLogServCacheConfig : public CBase
39 static CLogServCacheConfig* NewL(MLogServDatabaseTransactionInterface& aDatabase);
40 ~CLogServCacheConfig();
41 const TLogConfig& Config() const;
42 void UpdateL(const TLogConfig& aConfig);
44 inline TBool InTransaction() const;
47 inline void Rollback();
50 CLogServCacheConfig(MLogServDatabaseTransactionInterface& aDatabase);
55 MLogServDatabaseTransactionInterface& iDatabase;
56 TLogConfig iConfig;//The last good configuration value. Essentially, the current configuration
57 TLogConfig iRequestedConfiguration;//The requested configuration
58 TBool iInTransaction;//Indicates whether the configuration cache is currently within an update transaction
64 Indicates whether a configuration transaction has begun
66 inline TBool CLogServCacheConfig::InTransaction() const
68 return iInTransaction;
73 Roll back a configuration transaction
75 inline void CLogServCacheConfig::Rollback()
77 // Nothing really to do here other than discard the transaction status
78 // (ready to start over again).
79 iInTransaction = EFalse;