os/persistentdata/loggingservices/eventlogger/LogServ/inc/LogServDatabaseTransactionInterface.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef __LOGSERVDATABASETRANSACTIONINTERFACE_H__
    17 #define __LOGSERVDATABASETRANSACTIONINTERFACE_H__
    18 
    19 #include <d32dbms.h>
    20 #include "LogServShared.h"
    21 #include "logservsecurity.h"
    22 
    23 // Classes referenced
    24 class CLogServCacheTypes;
    25 class CLogServCacheConfig;
    26 class CLogServCacheStrings;
    27 class CLogServResourceInterpreter;
    28 class MLogServDatabaseChangeInterface;
    29 
    30 /**
    31 Interface class offering methods for:
    32  - beginning, committing and rolling back a transaction;
    33  - accessors to config, types and strings caches;
    34  - accessors to the resource interpreter and and the change interface;
    35  
    36 @see CLogServResourceInterpreter  
    37 @see MLogServDatabaseChangeInterface
    38 @see CLogServCacheStrings
    39 @see CLogServCacheTypes
    40 @see CLogServCacheConfig
    41 @internalComponent
    42 */
    43 class MLogServDatabaseTransactionInterface
    44 	{
    45 public:
    46 	virtual TInt DTIBegin() = 0;//Start a new transaction
    47 	virtual TInt DTICommitAndEnd() = 0;//End an existing transaction
    48 	virtual void DTIRollBack() = 0;//Roll back the current transaction
    49 	virtual TInt DTIExecuteSql(const TDesC& aStatement, TDbTextComparison aComparison = EDbCompareNormal) = 0;//Run some arbitrary SQL
    50 	virtual TBool DTIInTransaction() const = 0;//Is the database in an existing transaction
    51 	virtual TBool DTIDatabaseIsDamaged() const = 0;//Is the database in an existing transaction
    52 
    53 	virtual CLogServResourceInterpreter& DTIResourceInterface() const = 0;//Access the resource interface
    54 	virtual MLogServDatabaseChangeInterface& DTIChangeInterface() const = 0;//Acess the change submission interface
    55 	virtual CLogServCacheStrings& DTICacheStrings() const = 0;//Access the string table cache
    56 	virtual CLogServCacheTypes& DTICacheTypes() const = 0;//Access the type table cache
    57 	virtual CLogServCacheConfig& DTICacheConfig() const = 0;//Access the config table cache
    58 	virtual RDbDatabase& DTIDatabase() = 0;//Access the database
    59 	
    60 	virtual TBool DTIIsAllowed(TEventOp aEventOp, const RMessage2& aMessage, TUid aEventType, const char* aDiagnostic = 0) const = 0;//Check client capability
    61 	virtual const RArray<TUid>& DTIUidsOfStandardTypes() = 0;//Returns a collection of built-in TUids of built-types - those defined in Logwrap.rss
    62 
    63 	void DTIBeginWithRollBackProtectionLC();//Start a transaction with roll-back protection (cleanup)
    64 	void DTICommitAndCancelRollbackProtectionL();//End a transaction previously started with roll-back protection
    65 
    66 private:
    67 	static void RollBackDatabase(TAny* aObject);
    68 
    69 	};
    70 
    71 #endif