os/persistentdata/persistentstorage/dbms/pcdbms/inc/D32TABLE.H
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/persistentstorage/dbms/pcdbms/inc/D32TABLE.H	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,590 @@
     1.4 +// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#if !defined(__D32TABLE_H__)
    1.20 +#define __D32TABLE_H__
    1.21 +#if !defined(__D32DBAS_H__)
    1.22 +#include "D32DBAS.H"
    1.23 +#endif
    1.24 +#if !defined(__D32REC_H__)
    1.25 +#include "D32REC.H"
    1.26 +#endif
    1.27 +#if !defined(__D32CACHE_H__)
    1.28 +#include "D32CACHE.H"
    1.29 +#endif
    1.30 +
    1.31 +// classes defined in this file
    1.32 +class TDbGenerationMark;
    1.33 +class TDbColumnDef;
    1.34 +class HDbColumnSet;
    1.35 +class CDbTableIndexDef;
    1.36 +class RDbIndexes;
    1.37 +class RDbTableSchema;
    1.38 +class CDbTableDef;
    1.39 +class RDbTableRow;
    1.40 +class CDbTable;
    1.41 +class RDbTables;
    1.42 +class RDbTransaction;
    1.43 +class CDbTableDatabase;
    1.44 +
    1.45 +// classes also referenced
    1.46 +class CDbTableSource;
    1.47 +class CDbBlobCleanup;
    1.48 +
    1.49 +/**
    1.50 +@internalComponent
    1.51 +*/
    1.52 +const TInt KDbTableMaxIndexes = 32;
    1.53 +
    1.54 +/**
    1.55 +@internalComponent
    1.56 +*/
    1.57 +class CDbTableIndexDef : public CBase
    1.58 +	{
    1.59 +	friend class RDbIndexes;
    1.60 +public:
    1.61 +	IMPORT_C CDbTableIndexDef();
    1.62 +	IMPORT_C ~CDbTableIndexDef();
    1.63 +	IMPORT_C void ConstructL( const TDesC& aName );
    1.64 +	inline const TDesC& Name() const;
    1.65 +	inline const CDbKey& Key() const;
    1.66 +	inline CDbKey& Key();
    1.67 +private:
    1.68 +	TSglQueLink iLink;
    1.69 +	HBufC* iName;
    1.70 +	CDbKey iKey;
    1.71 +	};
    1.72 +
    1.73 +/**
    1.74 +@internalComponent
    1.75 +*/
    1.76 +class RDbIndexes
    1.77 +	{
    1.78 +	friend class CDbTableDef;
    1.79 +public:
    1.80 +	inline void Add( CDbTableIndexDef* aDef );
    1.81 +	inline void Remove( CDbTableIndexDef* aDef );
    1.82 +	inline const TSglQueBase& AsQue() const;
    1.83 +	CDbTableIndexDef* Find( const TDesC& aName ) const;
    1.84 +	CDbTableIndexDef& FindL( const TDesC& aName ) const;
    1.85 +	IMPORT_C TInt Count() const;
    1.86 +private:
    1.87 +	inline RDbIndexes();
    1.88 +	void Close();
    1.89 +private:
    1.90 +	TSglQue<CDbTableIndexDef> iRep;
    1.91 +	};
    1.92 +
    1.93 +/**
    1.94 +@internalComponent
    1.95 +*/
    1.96 +class TDbColumnDef
    1.97 +	{
    1.98 +public:
    1.99 +	IMPORT_C void SetL( const TDbCol& aCol );
   1.100 +	IMPORT_C void SetL( const TDbColumnDef& aCol );
   1.101 +	void AsTDbCol( TDbCol& aColumn ) const;
   1.102 +	inline TDbColType Type() const;
   1.103 +private:
   1.104 +// don't allow copies
   1.105 +	void operator=( const TDbColumnDef& );
   1.106 +public:
   1.107 +	// flags used by AlterTable
   1.108 +	enum { EDropped = 0x1, EChangedType = 0x2, EChangedLen = 0x4, EAdded = 0x8 };
   1.109 +public:
   1.110 +	HBufC* iName;
   1.111 +	TInt iMaxLength;
   1.112 +	TUint8 iType;
   1.113 +	TUint8 iAttributes;
   1.114 +	TUint8 iFlags;
   1.115 +	TUint8 iReserved;
   1.116 +	};
   1.117 +
   1.118 +/**
   1.119 +@internalComponent
   1.120 +*/
   1.121 +class HDbColumnSet
   1.122 +	{
   1.123 +private:
   1.124 +	enum { ELongColumns = 0x1, EAutoIncrement = 0x2 };
   1.125 +public:
   1.126 +	typedef TDbColumnDef* TIterator;
   1.127 +	typedef const TDbColumnDef* TIteratorC;
   1.128 +public:
   1.129 +	static HDbColumnSet* NewL( TInt aCount );
   1.130 +	~HDbColumnSet();
   1.131 +//
   1.132 +	inline TIterator Begin();
   1.133 +	void Complete();
   1.134 +	IMPORT_C TInt Count() const;
   1.135 +	inline TIteratorC Begin() const;
   1.136 +	inline TIteratorC End() const;
   1.137 +	inline const TDbColumnDef& operator[]( TDbColNo anIndex ) const;
   1.138 +	IMPORT_C TIteratorC ColumnL( const TDesC& aColumn ) const;
   1.139 +	inline TIterator ColumnL( const TDesC& aColumn );
   1.140 +	IMPORT_C TDbColNo ColNoL( const TDesC& aColumn ) const;
   1.141 +	inline TBool HasLongColumns() const;
   1.142 +	inline TBool HasAutoIncrement() const;
   1.143 +private:
   1.144 +	HDbColumnSet( TInt aCount );
   1.145 +	const TIteratorC* IndexL() const;
   1.146 +private:
   1.147 +	TUint iAttributes;
   1.148 +	TIteratorC* iIndex;
   1.149 +	const TDbColumnDef* const iEnd;
   1.150 +	TDbColumnDef iColumns[1];		// at least one
   1.151 +	};
   1.152 +
   1.153 +/**
   1.154 +@internalComponent
   1.155 +*/
   1.156 +class CDbTableDef : public CBase
   1.157 +	{
   1.158 +	friend class RDbTableSchema;
   1.159 +public:
   1.160 +	IMPORT_C ~CDbTableDef();
   1.161 +	inline const TDesC& Name() const;
   1.162 +	inline HDbColumnSet& Columns();
   1.163 +	inline const HDbColumnSet& Columns() const;
   1.164 +	inline RDbIndexes& Indexes();
   1.165 +	inline const RDbIndexes& Indexes() const;
   1.166 +	IMPORT_C virtual void Changed();
   1.167 +//
   1.168 +	inline const CDbTableIndexDef* Key( const TDesC& aColumn ) const;
   1.169 +	inline TBool IsIndexed( const TDesC& aColumn ) const;
   1.170 +//
   1.171 +	virtual void AlteredColumnSetL( HDbColumnSet& aSet, const CDbColSet& aChange, const CDbColSet& aAdd ) = 0;
   1.172 +	void ExchangeColumnSet( HDbColumnSet* aSet );
   1.173 +protected:
   1.174 +	IMPORT_C CDbTableDef();
   1.175 +	IMPORT_C void ConstructL( const TDesC& aName, TInt aColumnCount );
   1.176 +private:
   1.177 +	const CDbTableIndexDef* FindKey( const TDesC& aColumn, TBool aFirstColumn ) const;
   1.178 +private:
   1.179 +	TSglQueLink iLink;
   1.180 +	HBufC* iName;
   1.181 +	HDbColumnSet* iColumns;
   1.182 +	RDbIndexes iIndexes;
   1.183 +	};
   1.184 +
   1.185 +/**
   1.186 +@internalComponent
   1.187 +*/
   1.188 +class RDbTableSchema
   1.189 +	{
   1.190 +	friend class CDbTableDatabase;
   1.191 +public:
   1.192 +	inline void Loaded();
   1.193 +	inline operator TSglQueBase&();
   1.194 +	inline void Add( CDbTableDef* aDef );
   1.195 +//
   1.196 +	inline TBool IsEmpty() const;
   1.197 +	CDbTableDef* Find( const TDesC& aTable );
   1.198 +	CDbTableDef& FindL( const TDesC& aTable );
   1.199 +private:
   1.200 +	inline RDbTableSchema();
   1.201 +	void Close();
   1.202 +//
   1.203 +	inline TBool IsLoaded() const;
   1.204 +	void Discard();
   1.205 +	inline void Remove( CDbTableDef* aDef );
   1.206 +private:
   1.207 +	TSglQue<CDbTableDef> iRep;
   1.208 +	TBool iLoaded;
   1.209 +	};
   1.210 +
   1.211 +/**
   1.212 +@internalComponent
   1.213 +*/
   1.214 +typedef TUint TDbGeneration;
   1.215 +
   1.216 +/**
   1.217 +@internalComponent
   1.218 +*/
   1.219 +class TDbGenerationMark
   1.220 +	{
   1.221 +public:
   1.222 +	inline void Construct( const TDbGeneration& aGeneration );
   1.223 +	inline void Mark();
   1.224 +	inline TBool Changed() const;
   1.225 +private:
   1.226 +	const TDbGeneration* iGeneration;
   1.227 +	TDbGeneration iMark;
   1.228 +	};
   1.229 +
   1.230 +/**
   1.231 +@internalComponent
   1.232 +*/
   1.233 +class CDbTable : public CBase
   1.234 +	{
   1.235 +	friend class RDbTables;
   1.236 +public:
   1.237 +	class TValid;
   1.238 +	friend class TValid;
   1.239 +	enum { EUnavailableSpan = -1, EFullIndexSpan = 100 };
   1.240 +protected:
   1.241 +	IMPORT_C CDbTable( CDbTableDatabase& aDatabase, const CDbTableDef& aDef );
   1.242 +	IMPORT_C ~CDbTable();
   1.243 +public:
   1.244 +	void Open();
   1.245 +	void Close();
   1.246 +	void FlushL();
   1.247 +	void Abandon();
   1.248 +	void Release();
   1.249 +	void Idle();
   1.250 +//
   1.251 +	inline TBool IsActive() const;
   1.252 +	inline TBool IsIdle() const;
   1.253 +	inline const CDbTableDef& Def() const;
   1.254 +	inline CDbTableDatabase& Database();
   1.255 +//
   1.256 +	inline const TDbGeneration& Generation() const;
   1.257 +	TBool ExistsL( TDbRecordId aRecordId );
   1.258 +	void NewRowL( RDbRow& aRow );
   1.259 +	void ReadRowL( RDbRow& aRow, TDbRecordId aRecordId );
   1.260 +	void PrepareReplaceL( const RDbTableRow& aRow, TDbRecordId aRecordId );
   1.261 +	void ReplaceRowL( RDbTableRow& aRow, TDbRecordId aRecordId );
   1.262 +	void PrepareAppendL( const RDbTableRow& aRow );
   1.263 +	TDbRecordId AppendRowL( const RDbTableRow& aRow );
   1.264 +	void DeleteRowL( RDbTableRow& aRow, TDbRecordId aRecordId );
   1.265 +	void DuplicateBlobsL( RDbRow& aRow );
   1.266 +	IMPORT_C void DiscardBlobsL( RDbRow& aRow );
   1.267 +//
   1.268 +	IMPORT_C CDbRecordSpace& RecordsL();
   1.269 +	IMPORT_C CDbRecordIndex& IndexL( const CDbTableIndexDef& anIndex );
   1.270 +	IMPORT_C CDbBlobSpace* BlobsL();
   1.271 +	virtual CDbRecordIndex* RecordIndexL( const CDbTableIndexDef& anIndex ) = 0;
   1.272 +//
   1.273 +	CDbRecordIter* IteratorL();
   1.274 +	IMPORT_C virtual TInt IndexSpanL( const CDbTableIndexDef& aIndex, TUint aInclusion, const TDbLookupKey* aLowerBound, const TDbLookupKey* aUpperBound );
   1.275 +	CDbRecordIter* IteratorL( const CDbTableIndexDef& aIndex, TUint aInclusion = 0, const TDbLookupKey* aLowerBound = 0, const TDbLookupKey* aUpperBound = 0 );
   1.276 +	CDbRecordIter* IteratorL( const TDesC& aIndex );
   1.277 +private:
   1.278 +	typedef void ( *TBlobFuncL )( CDbBlobSpace& aBlobStore, TDbBlob& aBlob, TDbColType aType, CDbBlobCleanup* aCleanup );
   1.279 +private:
   1.280 +	inline void Discard();
   1.281 +	void Disconnect();
   1.282 +	inline TBool InUse() const;
   1.283 +	inline RDbCache& Cache();
   1.284 +//
   1.285 +	void ApplyToBlobsL( RDbRow& aRow, TBlobFuncL aFuncL, CDbBlobCleanup* aCleanup = 0 );
   1.286 +	void ApplyToComponentsL( void ( *anOperationL )( CDbRecordBase* ) );
   1.287 +	void EnsureIndexesL();
   1.288 +	void ValidateL( const RDbRow& aRow );
   1.289 +	void CheckInliningL( RDbRow& aRow );
   1.290 +	void DoReplaceRowL( const RDbRow& aRow, TDbRecordId aRecordId );
   1.291 +//
   1.292 +	virtual CDbRecordSpace* RecordSpaceL() = 0;
   1.293 +	virtual CDbBlobSpace* BlobSpaceL() = 0;
   1.294 +//
   1.295 +	virtual void CopyToRowL( RDbRow& aRow, const TDesC8& aRecord ) = 0;
   1.296 +	virtual TInt RecordLength( const RDbRow& aRow ) = 0;
   1.297 +	virtual void CopyFromRow( TUint8* aRecord, const RDbRow& aRow ) = 0;
   1.298 +private:
   1.299 +	enum { EIdle = -1, ECached = -2 };
   1.300 +private:
   1.301 +	TSglQueLink iLink;
   1.302 +	TInt iRef;
   1.303 +	CDbTableDatabase* iDatabase;
   1.304 +	const CDbTableDef* iDef;
   1.305 +	TDbGeneration iGeneration;
   1.306 +	CDbRecordSpace* iRecords;
   1.307 +	CDbBlobSpace* iBlobs;
   1.308 +	CDbRecordIndex* iIndexes[KDbTableMaxIndexes];
   1.309 +	CDbRecordIndex** iIndexesEnd;
   1.310 +	TUint32 iUpdateMap;
   1.311 +	};
   1.312 +
   1.313 +/**
   1.314 +@internalComponent
   1.315 +*/
   1.316 +class RDbTableRow : public RDbRow
   1.317 +	{
   1.318 +public:
   1.319 +	inline RDbTableRow();
   1.320 +	void Open( CDbTable* aTable );
   1.321 +	void Close();
   1.322 +//
   1.323 +	inline CDbTable& Table() const;
   1.324 +	IMPORT_C void ReadL( TDbRecordId aRecordId );
   1.325 +	void NewL( TDbRecordId aCopyRecord );
   1.326 +	void PrepareAppendL();
   1.327 +	TDbRecordId AppendL();
   1.328 +	void PrepareReplaceL();
   1.329 +	TDbRecordId ReplaceL();
   1.330 +	void DeleteL( TDbRecordId aRecordId );
   1.331 +private:
   1.332 +	TDbGenerationMark iMark;
   1.333 +	TDbRecordId iRecord;
   1.334 +	CDbTable* iTable;
   1.335 +	};
   1.336 +
   1.337 +/**
   1.338 +implementation class
   1.339 +@internalComponent
   1.340 +*/
   1.341 +class RDbTables		
   1.342 +	{
   1.343 +public:
   1.344 +	inline RDbTables();
   1.345 +	void Close();
   1.346 +//
   1.347 +	inline TBool IsEmpty() const;
   1.348 +	inline void Add( CDbTable& aTable );
   1.349 +	inline void Remove( CDbTable& aTable );
   1.350 +	CDbTable* Find( const TDesC& aTable );
   1.351 +	inline operator TSglQueBase&();
   1.352 +private:
   1.353 +	TSglQue<CDbTable> iRep;
   1.354 +	};
   1.355 +
   1.356 +/**
   1.357 +@internalComponent
   1.358 +*/
   1.359 +enum TDbLockType { EDbReadLock = 0, EDbXReadLock, EDbWriteLock, EDbCompactLock, EDbRecoveryLock, EDbSchemaLock };
   1.360 +
   1.361 +/**
   1.362 +implementation class
   1.363 +@internalComponent
   1.364 +*/
   1.365 +class RDbTransaction
   1.366 +	{
   1.367 +private:
   1.368 +	class CNotifier;
   1.369 +	friend class CNotifier;
   1.370 +public:
   1.371 +	inline RDbTransaction();
   1.372 +	inline void Open( CDbTableDatabase& aDatabase );
   1.373 +	void Close();
   1.374 +//
   1.375 +	inline const TDbGeneration& RollbackGeneration() const;
   1.376 +	inline CDbTableDatabase& Database();
   1.377 +//
   1.378 +	void BeginL( const CDbObject& aObject );
   1.379 +	void CommitL( const CDbObject& aObject );
   1.380 +	void Rollback( const CDbObject& aObject );
   1.381 +//
   1.382 +	void ReadPrepareL( const CDbObject& aObject );
   1.383 +	void ReadBegin( const CDbObject& aObject );
   1.384 +	void ReadRelease( const CDbObject& aObject );
   1.385 +//
   1.386 +	void DMLCheckL();
   1.387 +	void DMLPrepareL( const CDbObject& aObject );
   1.388 +	void DMLBegin();
   1.389 +	void DMLTouch();
   1.390 +	void DMLBeginLC();
   1.391 +	void DMLCommitL();
   1.392 +	void DMLRollback();
   1.393 +//
   1.394 +	void DDLPrepareL( const CDbObject& aObject );
   1.395 +	void DDLBegin();
   1.396 +	void DDLBeginLC();
   1.397 +	void DDLCommitL();
   1.398 +	void DDLRollback();
   1.399 +//
   1.400 +	void UtilityPrepareL( const CDbObject& aObject );
   1.401 +	void UtilityBegin( CDbDatabase::TUtility aType );
   1.402 +	void UtilityCommitL();
   1.403 +	void UtilityRollback();
   1.404 +//
   1.405 +	inline TBool IsLocked() const;
   1.406 +	inline void ReadyL() const;
   1.407 +	TBool InTransaction( const CDbObject& aObject );
   1.408 +//
   1.409 +	CDbNotifier* NotifierL();
   1.410 +#ifdef _ASSERTIONS
   1.411 +	void _Invariant() const;
   1.412 +#endif
   1.413 +private:
   1.414 +	typedef const CDbContext* THolder;
   1.415 +	struct TLock
   1.416 +		{
   1.417 +		THolder iHolder;
   1.418 +		TUint iState;
   1.419 +		};
   1.420 +	enum { ELockListGranularity = 4 };
   1.421 +	enum { ETransactionLock = 0x80000000 };
   1.422 +	enum { EState = 0x7f, EFailed = 0x80 };
   1.423 +	enum { EMaxLock = 255 };
   1.424 +private:
   1.425 +	inline TDbLockType LockState() const;
   1.426 +	void PrepareSLockL( const CDbObject& aObject, TUint aInitState );
   1.427 +	void PrepareXLockL( const CDbObject& aObject );
   1.428 +	void Unlock( RDbNotifier::TEvent aEvent );
   1.429 +	void Unlock( TLock& aLock );
   1.430 +	TLock* GetLock( const CDbObject& aObject );
   1.431 +	void Event( RDbNotifier::TEvent aEvent );
   1.432 +//
   1.433 +	void DoCommitL();
   1.434 +	void DoRollback();
   1.435 +	static void DMLAbandon( TAny* aPtr );
   1.436 +	static void DDLAbandon( TAny* aPtr );
   1.437 +private:
   1.438 +	CDbTableDatabase* iDatabase;
   1.439 +	TUint8 iAction;
   1.440 +	TUint8 iLockState;
   1.441 +	TUint8 iLockCount;
   1.442 +	TUint8 iMaxLock;
   1.443 +	TInt iUpdaters;
   1.444 +	TLock iPrimary;
   1.445 +	TLock* iSharers;
   1.446 +	TDbGeneration iRollback;
   1.447 +	CNotifier* iNotifier;
   1.448 +	};
   1.449 +
   1.450 +/**
   1.451 +@internalComponent
   1.452 +*/
   1.453 +class CDbTableDatabase : public CBase
   1.454 +	{
   1.455 +private:
   1.456 +	class CIncremental;
   1.457 +	class CIncrementalDDL;
   1.458 +	class CCreateIndex;
   1.459 +	class CDropIndex;
   1.460 +	class CDropTable;
   1.461 +	class CAlterTable;
   1.462 +	class CUtility;
   1.463 +	class CInterface;
   1.464 +	class CSource;
   1.465 +//
   1.466 +	friend class RDbTransaction;
   1.467 +	friend class CInterface;
   1.468 +	friend class CSource;
   1.469 +	friend class CDbTable;
   1.470 +	friend class CIncremental;
   1.471 +public:
   1.472 +	/**
   1.473 +	@internalComponent
   1.474 +	*/
   1.475 +	class CStepper : public CBase
   1.476 +		{
   1.477 +	protected:
   1.478 +		CStepper() {}
   1.479 +	public:
   1.480 +		virtual TInt StepL( TInt aStep ) = 0;
   1.481 +		};
   1.482 +
   1.483 +	/**
   1.484 +	@internalComponent
   1.485 +	*/
   1.486 +	class CMultiStepper : public CStepper
   1.487 +		{
   1.488 +	private:
   1.489 +		struct SStepper
   1.490 +			{
   1.491 +			CStepper* iStepper;
   1.492 +			TInt iStep;
   1.493 +			};
   1.494 +	public:
   1.495 +		~CMultiStepper();
   1.496 +		IMPORT_C static CMultiStepper* NewL( TInt aStepperCount );
   1.497 +		IMPORT_C void AddStepper( CStepper* aStepper, TInt aSteps );
   1.498 +		IMPORT_C TInt TotalSteps();
   1.499 +		TInt StepL( TInt aStep );
   1.500 +	private:
   1.501 +		inline CMultiStepper( TInt aStepperCount );
   1.502 +	private:
   1.503 +		SStepper* iStepper;
   1.504 +		SStepper* iEnd;
   1.505 +		SStepper iSteppers[1];		// one or more
   1.506 +		};
   1.507 +
   1.508 +	/**
   1.509 +	@internalComponent
   1.510 +	*/
   1.511 +	class CBuildIndex : public CStepper
   1.512 +		{
   1.513 +	private:
   1.514 +		enum { ERecordsPerStep = 16 };
   1.515 +	public:
   1.516 +		IMPORT_C static CBuildIndex* NewL( CDbTableDatabase& aDatabase, const CDbTableDef& aTable, const CDbTableIndexDef& anIndex );
   1.517 +		~CBuildIndex();
   1.518 +		IMPORT_C static TInt Steps( TInt aCardinality );
   1.519 +		inline CDbRecordIndex& Index();
   1.520 +		IMPORT_C TInt StepsL();
   1.521 +		// from CStepper
   1.522 +		TInt StepL( TInt aStep );
   1.523 +	private:
   1.524 +		CBuildIndex();
   1.525 +	private:
   1.526 +		CDbTableSource* iSource;
   1.527 +		TDbPosition iNext;
   1.528 +		CDbRecordIndex* iIndex;
   1.529 +		};
   1.530 +protected:
   1.531 +	IMPORT_C CDbTableDatabase();
   1.532 +	IMPORT_C ~CDbTableDatabase();
   1.533 +public:
   1.534 +	inline RDbTransaction& Transaction();
   1.535 +//
   1.536 +	IMPORT_C CDbDatabase* InterfaceL();
   1.537 +	IMPORT_C CDbSource* SourceL();
   1.538 +//
   1.539 +	inline RDbTableSchema& Schema();
   1.540 +	IMPORT_C RDbTableSchema& SchemaL();
   1.541 +//
   1.542 +	CDbTableSource* TableSourceL( const TDesC& aTableName );
   1.543 +	void Release( const CDbTableDef& aDef );
   1.544 +// framework functions
   1.545 +	virtual CStepper* TableAlterL( CDbTableDef& aTable, const HDbColumnSet& aNewSet, TInt& aStep ) = 0;
   1.546 +	virtual CStepper* RecordDiscarderL( const CDbTableDef& aTable, TInt& aStep ) = 0;
   1.547 +	virtual CStepper* IndexDiscarderL( const CDbTableDef& aTable, const CDbTableIndexDef& anIndex, TInt& aStep ) = 0;
   1.548 +	IMPORT_C virtual CStepper* UtilityL( CDbDatabase::TUtility aType, TInt& aStep );
   1.549 +protected:
   1.550 +// framework
   1.551 +	IMPORT_C virtual TInt Property( CDbDatabase::TProperty aProperty );
   1.552 +private:
   1.553 +//framework
   1.554 +	virtual void AuthenticateL() = 0;
   1.555 +	IMPORT_C virtual void Idle();
   1.556 +	virtual void LoadSchemaL() = 0;
   1.557 +	virtual void SynchL( TDbLockType aLock ) = 0;
   1.558 +	virtual void Revert( TDbLockType aLock ) = 0;
   1.559 +	virtual CDbTable* TableL( const CDbTableDef& aDef ) = 0;
   1.560 +	virtual CDbTableDef* CreateTableL( const TDesC& aName, const CDbColSet& aColSet, const CDbKey* aPrimaryKey ) = 0;
   1.561 +	virtual CDbTableIndexDef* CreateIndexL( const CDbTableDef& aTable, const TDesC& aName, const CDbKey& aKey ) = 0;
   1.562 +	virtual void DestroyL() = 0;
   1.563 +//
   1.564 +	inline void Open();
   1.565 +	void Close();
   1.566 +	inline void AddTable( CDbTable& aTable );
   1.567 +	void RemoveTable( CDbTable& aTable );
   1.568 +//
   1.569 +	void CheckIdle();
   1.570 +	void FlushL( TDbLockType aLock );
   1.571 +	void Abandon( TDbLockType aLock );
   1.572 +	void Release();
   1.573 +
   1.574 +	void DoCreateTableL( const TDesC& aName, const CDbColSet& aColSet, const CDbKey* aPrimaryKey );
   1.575 +	CIncremental* OpenCreateIndexL( const TDesC& aName, const TDesC& aTable, const CDbKey& aKey, TInt& aStep );
   1.576 +	CIncremental* OpenDropIndexL( const TDesC& aName, const TDesC& aTable, TInt& aStep );
   1.577 +	CIncremental* OpenDropTableL( const TDesC& aTable, TInt& aStep );
   1.578 +	CIncremental* OpenAlterTableL( const TDesC& aTable, const CDbColSet& aNewDef, TInt& aStep );
   1.579 +	CDbCursor* PrepareViewL( const TDbQuery& aQuery, const TDbWindow& aWindow, RDbRowSet::TAccess anAccess );
   1.580 +	CDbCursor* PrepareTableL( const TDesC& aTable, RDbRowSet::TAccess anAccess );
   1.581 +// reserved virtual function space
   1.582 +	IMPORT_C virtual void Reserved_1();
   1.583 +	IMPORT_C virtual void Reserved_2();
   1.584 +private:
   1.585 +	TInt iRef;
   1.586 +	RDbCache iCache;
   1.587 +	RDbTransaction iTransaction;
   1.588 +	RDbTableSchema iSchema;
   1.589 +	RDbTables iTables;
   1.590 +	};
   1.591 +
   1.592 +#include "D32TABLE.INL"
   1.593 +#endif