persistentstorage/dbms/pcdbms/inc/D32TABLE.H
changeset 0 08ec8eefde2f
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     1 // Copyright (c) 1998-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 #if !defined(__D32TABLE_H__)
       
    17 #define __D32TABLE_H__
       
    18 #if !defined(__D32DBAS_H__)
       
    19 #include "D32DBAS.H"
       
    20 #endif
       
    21 #if !defined(__D32REC_H__)
       
    22 #include "D32REC.H"
       
    23 #endif
       
    24 #if !defined(__D32CACHE_H__)
       
    25 #include "D32CACHE.H"
       
    26 #endif
       
    27 
       
    28 // classes defined in this file
       
    29 class TDbGenerationMark;
       
    30 class TDbColumnDef;
       
    31 class HDbColumnSet;
       
    32 class CDbTableIndexDef;
       
    33 class RDbIndexes;
       
    34 class RDbTableSchema;
       
    35 class CDbTableDef;
       
    36 class RDbTableRow;
       
    37 class CDbTable;
       
    38 class RDbTables;
       
    39 class RDbTransaction;
       
    40 class CDbTableDatabase;
       
    41 
       
    42 // classes also referenced
       
    43 class CDbTableSource;
       
    44 class CDbBlobCleanup;
       
    45 
       
    46 /**
       
    47 @internalComponent
       
    48 */
       
    49 const TInt KDbTableMaxIndexes = 32;
       
    50 
       
    51 /**
       
    52 @internalComponent
       
    53 */
       
    54 class CDbTableIndexDef : public CBase
       
    55 	{
       
    56 	friend class RDbIndexes;
       
    57 public:
       
    58 	IMPORT_C CDbTableIndexDef();
       
    59 	IMPORT_C ~CDbTableIndexDef();
       
    60 	IMPORT_C void ConstructL( const TDesC& aName );
       
    61 	inline const TDesC& Name() const;
       
    62 	inline const CDbKey& Key() const;
       
    63 	inline CDbKey& Key();
       
    64 private:
       
    65 	TSglQueLink iLink;
       
    66 	HBufC* iName;
       
    67 	CDbKey iKey;
       
    68 	};
       
    69 
       
    70 /**
       
    71 @internalComponent
       
    72 */
       
    73 class RDbIndexes
       
    74 	{
       
    75 	friend class CDbTableDef;
       
    76 public:
       
    77 	inline void Add( CDbTableIndexDef* aDef );
       
    78 	inline void Remove( CDbTableIndexDef* aDef );
       
    79 	inline const TSglQueBase& AsQue() const;
       
    80 	CDbTableIndexDef* Find( const TDesC& aName ) const;
       
    81 	CDbTableIndexDef& FindL( const TDesC& aName ) const;
       
    82 	IMPORT_C TInt Count() const;
       
    83 private:
       
    84 	inline RDbIndexes();
       
    85 	void Close();
       
    86 private:
       
    87 	TSglQue<CDbTableIndexDef> iRep;
       
    88 	};
       
    89 
       
    90 /**
       
    91 @internalComponent
       
    92 */
       
    93 class TDbColumnDef
       
    94 	{
       
    95 public:
       
    96 	IMPORT_C void SetL( const TDbCol& aCol );
       
    97 	IMPORT_C void SetL( const TDbColumnDef& aCol );
       
    98 	void AsTDbCol( TDbCol& aColumn ) const;
       
    99 	inline TDbColType Type() const;
       
   100 private:
       
   101 // don't allow copies
       
   102 	void operator=( const TDbColumnDef& );
       
   103 public:
       
   104 	// flags used by AlterTable
       
   105 	enum { EDropped = 0x1, EChangedType = 0x2, EChangedLen = 0x4, EAdded = 0x8 };
       
   106 public:
       
   107 	HBufC* iName;
       
   108 	TInt iMaxLength;
       
   109 	TUint8 iType;
       
   110 	TUint8 iAttributes;
       
   111 	TUint8 iFlags;
       
   112 	TUint8 iReserved;
       
   113 	};
       
   114 
       
   115 /**
       
   116 @internalComponent
       
   117 */
       
   118 class HDbColumnSet
       
   119 	{
       
   120 private:
       
   121 	enum { ELongColumns = 0x1, EAutoIncrement = 0x2 };
       
   122 public:
       
   123 	typedef TDbColumnDef* TIterator;
       
   124 	typedef const TDbColumnDef* TIteratorC;
       
   125 public:
       
   126 	static HDbColumnSet* NewL( TInt aCount );
       
   127 	~HDbColumnSet();
       
   128 //
       
   129 	inline TIterator Begin();
       
   130 	void Complete();
       
   131 	IMPORT_C TInt Count() const;
       
   132 	inline TIteratorC Begin() const;
       
   133 	inline TIteratorC End() const;
       
   134 	inline const TDbColumnDef& operator[]( TDbColNo anIndex ) const;
       
   135 	IMPORT_C TIteratorC ColumnL( const TDesC& aColumn ) const;
       
   136 	inline TIterator ColumnL( const TDesC& aColumn );
       
   137 	IMPORT_C TDbColNo ColNoL( const TDesC& aColumn ) const;
       
   138 	inline TBool HasLongColumns() const;
       
   139 	inline TBool HasAutoIncrement() const;
       
   140 private:
       
   141 	HDbColumnSet( TInt aCount );
       
   142 	const TIteratorC* IndexL() const;
       
   143 private:
       
   144 	TUint iAttributes;
       
   145 	TIteratorC* iIndex;
       
   146 	const TDbColumnDef* const iEnd;
       
   147 	TDbColumnDef iColumns[1];		// at least one
       
   148 	};
       
   149 
       
   150 /**
       
   151 @internalComponent
       
   152 */
       
   153 class CDbTableDef : public CBase
       
   154 	{
       
   155 	friend class RDbTableSchema;
       
   156 public:
       
   157 	IMPORT_C ~CDbTableDef();
       
   158 	inline const TDesC& Name() const;
       
   159 	inline HDbColumnSet& Columns();
       
   160 	inline const HDbColumnSet& Columns() const;
       
   161 	inline RDbIndexes& Indexes();
       
   162 	inline const RDbIndexes& Indexes() const;
       
   163 	IMPORT_C virtual void Changed();
       
   164 //
       
   165 	inline const CDbTableIndexDef* Key( const TDesC& aColumn ) const;
       
   166 	inline TBool IsIndexed( const TDesC& aColumn ) const;
       
   167 //
       
   168 	virtual void AlteredColumnSetL( HDbColumnSet& aSet, const CDbColSet& aChange, const CDbColSet& aAdd ) = 0;
       
   169 	void ExchangeColumnSet( HDbColumnSet* aSet );
       
   170 protected:
       
   171 	IMPORT_C CDbTableDef();
       
   172 	IMPORT_C void ConstructL( const TDesC& aName, TInt aColumnCount );
       
   173 private:
       
   174 	const CDbTableIndexDef* FindKey( const TDesC& aColumn, TBool aFirstColumn ) const;
       
   175 private:
       
   176 	TSglQueLink iLink;
       
   177 	HBufC* iName;
       
   178 	HDbColumnSet* iColumns;
       
   179 	RDbIndexes iIndexes;
       
   180 	};
       
   181 
       
   182 /**
       
   183 @internalComponent
       
   184 */
       
   185 class RDbTableSchema
       
   186 	{
       
   187 	friend class CDbTableDatabase;
       
   188 public:
       
   189 	inline void Loaded();
       
   190 	inline operator TSglQueBase&();
       
   191 	inline void Add( CDbTableDef* aDef );
       
   192 //
       
   193 	inline TBool IsEmpty() const;
       
   194 	CDbTableDef* Find( const TDesC& aTable );
       
   195 	CDbTableDef& FindL( const TDesC& aTable );
       
   196 private:
       
   197 	inline RDbTableSchema();
       
   198 	void Close();
       
   199 //
       
   200 	inline TBool IsLoaded() const;
       
   201 	void Discard();
       
   202 	inline void Remove( CDbTableDef* aDef );
       
   203 private:
       
   204 	TSglQue<CDbTableDef> iRep;
       
   205 	TBool iLoaded;
       
   206 	};
       
   207 
       
   208 /**
       
   209 @internalComponent
       
   210 */
       
   211 typedef TUint TDbGeneration;
       
   212 
       
   213 /**
       
   214 @internalComponent
       
   215 */
       
   216 class TDbGenerationMark
       
   217 	{
       
   218 public:
       
   219 	inline void Construct( const TDbGeneration& aGeneration );
       
   220 	inline void Mark();
       
   221 	inline TBool Changed() const;
       
   222 private:
       
   223 	const TDbGeneration* iGeneration;
       
   224 	TDbGeneration iMark;
       
   225 	};
       
   226 
       
   227 /**
       
   228 @internalComponent
       
   229 */
       
   230 class CDbTable : public CBase
       
   231 	{
       
   232 	friend class RDbTables;
       
   233 public:
       
   234 	class TValid;
       
   235 	friend class TValid;
       
   236 	enum { EUnavailableSpan = -1, EFullIndexSpan = 100 };
       
   237 protected:
       
   238 	IMPORT_C CDbTable( CDbTableDatabase& aDatabase, const CDbTableDef& aDef );
       
   239 	IMPORT_C ~CDbTable();
       
   240 public:
       
   241 	void Open();
       
   242 	void Close();
       
   243 	void FlushL();
       
   244 	void Abandon();
       
   245 	void Release();
       
   246 	void Idle();
       
   247 //
       
   248 	inline TBool IsActive() const;
       
   249 	inline TBool IsIdle() const;
       
   250 	inline const CDbTableDef& Def() const;
       
   251 	inline CDbTableDatabase& Database();
       
   252 //
       
   253 	inline const TDbGeneration& Generation() const;
       
   254 	TBool ExistsL( TDbRecordId aRecordId );
       
   255 	void NewRowL( RDbRow& aRow );
       
   256 	void ReadRowL( RDbRow& aRow, TDbRecordId aRecordId );
       
   257 	void PrepareReplaceL( const RDbTableRow& aRow, TDbRecordId aRecordId );
       
   258 	void ReplaceRowL( RDbTableRow& aRow, TDbRecordId aRecordId );
       
   259 	void PrepareAppendL( const RDbTableRow& aRow );
       
   260 	TDbRecordId AppendRowL( const RDbTableRow& aRow );
       
   261 	void DeleteRowL( RDbTableRow& aRow, TDbRecordId aRecordId );
       
   262 	void DuplicateBlobsL( RDbRow& aRow );
       
   263 	IMPORT_C void DiscardBlobsL( RDbRow& aRow );
       
   264 //
       
   265 	IMPORT_C CDbRecordSpace& RecordsL();
       
   266 	IMPORT_C CDbRecordIndex& IndexL( const CDbTableIndexDef& anIndex );
       
   267 	IMPORT_C CDbBlobSpace* BlobsL();
       
   268 	virtual CDbRecordIndex* RecordIndexL( const CDbTableIndexDef& anIndex ) = 0;
       
   269 //
       
   270 	CDbRecordIter* IteratorL();
       
   271 	IMPORT_C virtual TInt IndexSpanL( const CDbTableIndexDef& aIndex, TUint aInclusion, const TDbLookupKey* aLowerBound, const TDbLookupKey* aUpperBound );
       
   272 	CDbRecordIter* IteratorL( const CDbTableIndexDef& aIndex, TUint aInclusion = 0, const TDbLookupKey* aLowerBound = 0, const TDbLookupKey* aUpperBound = 0 );
       
   273 	CDbRecordIter* IteratorL( const TDesC& aIndex );
       
   274 private:
       
   275 	typedef void ( *TBlobFuncL )( CDbBlobSpace& aBlobStore, TDbBlob& aBlob, TDbColType aType, CDbBlobCleanup* aCleanup );
       
   276 private:
       
   277 	inline void Discard();
       
   278 	void Disconnect();
       
   279 	inline TBool InUse() const;
       
   280 	inline RDbCache& Cache();
       
   281 //
       
   282 	void ApplyToBlobsL( RDbRow& aRow, TBlobFuncL aFuncL, CDbBlobCleanup* aCleanup = 0 );
       
   283 	void ApplyToComponentsL( void ( *anOperationL )( CDbRecordBase* ) );
       
   284 	void EnsureIndexesL();
       
   285 	void ValidateL( const RDbRow& aRow );
       
   286 	void CheckInliningL( RDbRow& aRow );
       
   287 	void DoReplaceRowL( const RDbRow& aRow, TDbRecordId aRecordId );
       
   288 //
       
   289 	virtual CDbRecordSpace* RecordSpaceL() = 0;
       
   290 	virtual CDbBlobSpace* BlobSpaceL() = 0;
       
   291 //
       
   292 	virtual void CopyToRowL( RDbRow& aRow, const TDesC8& aRecord ) = 0;
       
   293 	virtual TInt RecordLength( const RDbRow& aRow ) = 0;
       
   294 	virtual void CopyFromRow( TUint8* aRecord, const RDbRow& aRow ) = 0;
       
   295 private:
       
   296 	enum { EIdle = -1, ECached = -2 };
       
   297 private:
       
   298 	TSglQueLink iLink;
       
   299 	TInt iRef;
       
   300 	CDbTableDatabase* iDatabase;
       
   301 	const CDbTableDef* iDef;
       
   302 	TDbGeneration iGeneration;
       
   303 	CDbRecordSpace* iRecords;
       
   304 	CDbBlobSpace* iBlobs;
       
   305 	CDbRecordIndex* iIndexes[KDbTableMaxIndexes];
       
   306 	CDbRecordIndex** iIndexesEnd;
       
   307 	TUint32 iUpdateMap;
       
   308 	};
       
   309 
       
   310 /**
       
   311 @internalComponent
       
   312 */
       
   313 class RDbTableRow : public RDbRow
       
   314 	{
       
   315 public:
       
   316 	inline RDbTableRow();
       
   317 	void Open( CDbTable* aTable );
       
   318 	void Close();
       
   319 //
       
   320 	inline CDbTable& Table() const;
       
   321 	IMPORT_C void ReadL( TDbRecordId aRecordId );
       
   322 	void NewL( TDbRecordId aCopyRecord );
       
   323 	void PrepareAppendL();
       
   324 	TDbRecordId AppendL();
       
   325 	void PrepareReplaceL();
       
   326 	TDbRecordId ReplaceL();
       
   327 	void DeleteL( TDbRecordId aRecordId );
       
   328 private:
       
   329 	TDbGenerationMark iMark;
       
   330 	TDbRecordId iRecord;
       
   331 	CDbTable* iTable;
       
   332 	};
       
   333 
       
   334 /**
       
   335 implementation class
       
   336 @internalComponent
       
   337 */
       
   338 class RDbTables		
       
   339 	{
       
   340 public:
       
   341 	inline RDbTables();
       
   342 	void Close();
       
   343 //
       
   344 	inline TBool IsEmpty() const;
       
   345 	inline void Add( CDbTable& aTable );
       
   346 	inline void Remove( CDbTable& aTable );
       
   347 	CDbTable* Find( const TDesC& aTable );
       
   348 	inline operator TSglQueBase&();
       
   349 private:
       
   350 	TSglQue<CDbTable> iRep;
       
   351 	};
       
   352 
       
   353 /**
       
   354 @internalComponent
       
   355 */
       
   356 enum TDbLockType { EDbReadLock = 0, EDbXReadLock, EDbWriteLock, EDbCompactLock, EDbRecoveryLock, EDbSchemaLock };
       
   357 
       
   358 /**
       
   359 implementation class
       
   360 @internalComponent
       
   361 */
       
   362 class RDbTransaction
       
   363 	{
       
   364 private:
       
   365 	class CNotifier;
       
   366 	friend class CNotifier;
       
   367 public:
       
   368 	inline RDbTransaction();
       
   369 	inline void Open( CDbTableDatabase& aDatabase );
       
   370 	void Close();
       
   371 //
       
   372 	inline const TDbGeneration& RollbackGeneration() const;
       
   373 	inline CDbTableDatabase& Database();
       
   374 //
       
   375 	void BeginL( const CDbObject& aObject );
       
   376 	void CommitL( const CDbObject& aObject );
       
   377 	void Rollback( const CDbObject& aObject );
       
   378 //
       
   379 	void ReadPrepareL( const CDbObject& aObject );
       
   380 	void ReadBegin( const CDbObject& aObject );
       
   381 	void ReadRelease( const CDbObject& aObject );
       
   382 //
       
   383 	void DMLCheckL();
       
   384 	void DMLPrepareL( const CDbObject& aObject );
       
   385 	void DMLBegin();
       
   386 	void DMLTouch();
       
   387 	void DMLBeginLC();
       
   388 	void DMLCommitL();
       
   389 	void DMLRollback();
       
   390 //
       
   391 	void DDLPrepareL( const CDbObject& aObject );
       
   392 	void DDLBegin();
       
   393 	void DDLBeginLC();
       
   394 	void DDLCommitL();
       
   395 	void DDLRollback();
       
   396 //
       
   397 	void UtilityPrepareL( const CDbObject& aObject );
       
   398 	void UtilityBegin( CDbDatabase::TUtility aType );
       
   399 	void UtilityCommitL();
       
   400 	void UtilityRollback();
       
   401 //
       
   402 	inline TBool IsLocked() const;
       
   403 	inline void ReadyL() const;
       
   404 	TBool InTransaction( const CDbObject& aObject );
       
   405 //
       
   406 	CDbNotifier* NotifierL();
       
   407 #ifdef _ASSERTIONS
       
   408 	void _Invariant() const;
       
   409 #endif
       
   410 private:
       
   411 	typedef const CDbContext* THolder;
       
   412 	struct TLock
       
   413 		{
       
   414 		THolder iHolder;
       
   415 		TUint iState;
       
   416 		};
       
   417 	enum { ELockListGranularity = 4 };
       
   418 	enum { ETransactionLock = 0x80000000 };
       
   419 	enum { EState = 0x7f, EFailed = 0x80 };
       
   420 	enum { EMaxLock = 255 };
       
   421 private:
       
   422 	inline TDbLockType LockState() const;
       
   423 	void PrepareSLockL( const CDbObject& aObject, TUint aInitState );
       
   424 	void PrepareXLockL( const CDbObject& aObject );
       
   425 	void Unlock( RDbNotifier::TEvent aEvent );
       
   426 	void Unlock( TLock& aLock );
       
   427 	TLock* GetLock( const CDbObject& aObject );
       
   428 	void Event( RDbNotifier::TEvent aEvent );
       
   429 //
       
   430 	void DoCommitL();
       
   431 	void DoRollback();
       
   432 	static void DMLAbandon( TAny* aPtr );
       
   433 	static void DDLAbandon( TAny* aPtr );
       
   434 private:
       
   435 	CDbTableDatabase* iDatabase;
       
   436 	TUint8 iAction;
       
   437 	TUint8 iLockState;
       
   438 	TUint8 iLockCount;
       
   439 	TUint8 iMaxLock;
       
   440 	TInt iUpdaters;
       
   441 	TLock iPrimary;
       
   442 	TLock* iSharers;
       
   443 	TDbGeneration iRollback;
       
   444 	CNotifier* iNotifier;
       
   445 	};
       
   446 
       
   447 /**
       
   448 @internalComponent
       
   449 */
       
   450 class CDbTableDatabase : public CBase
       
   451 	{
       
   452 private:
       
   453 	class CIncremental;
       
   454 	class CIncrementalDDL;
       
   455 	class CCreateIndex;
       
   456 	class CDropIndex;
       
   457 	class CDropTable;
       
   458 	class CAlterTable;
       
   459 	class CUtility;
       
   460 	class CInterface;
       
   461 	class CSource;
       
   462 //
       
   463 	friend class RDbTransaction;
       
   464 	friend class CInterface;
       
   465 	friend class CSource;
       
   466 	friend class CDbTable;
       
   467 	friend class CIncremental;
       
   468 public:
       
   469 	/**
       
   470 	@internalComponent
       
   471 	*/
       
   472 	class CStepper : public CBase
       
   473 		{
       
   474 	protected:
       
   475 		CStepper() {}
       
   476 	public:
       
   477 		virtual TInt StepL( TInt aStep ) = 0;
       
   478 		};
       
   479 
       
   480 	/**
       
   481 	@internalComponent
       
   482 	*/
       
   483 	class CMultiStepper : public CStepper
       
   484 		{
       
   485 	private:
       
   486 		struct SStepper
       
   487 			{
       
   488 			CStepper* iStepper;
       
   489 			TInt iStep;
       
   490 			};
       
   491 	public:
       
   492 		~CMultiStepper();
       
   493 		IMPORT_C static CMultiStepper* NewL( TInt aStepperCount );
       
   494 		IMPORT_C void AddStepper( CStepper* aStepper, TInt aSteps );
       
   495 		IMPORT_C TInt TotalSteps();
       
   496 		TInt StepL( TInt aStep );
       
   497 	private:
       
   498 		inline CMultiStepper( TInt aStepperCount );
       
   499 	private:
       
   500 		SStepper* iStepper;
       
   501 		SStepper* iEnd;
       
   502 		SStepper iSteppers[1];		// one or more
       
   503 		};
       
   504 
       
   505 	/**
       
   506 	@internalComponent
       
   507 	*/
       
   508 	class CBuildIndex : public CStepper
       
   509 		{
       
   510 	private:
       
   511 		enum { ERecordsPerStep = 16 };
       
   512 	public:
       
   513 		IMPORT_C static CBuildIndex* NewL( CDbTableDatabase& aDatabase, const CDbTableDef& aTable, const CDbTableIndexDef& anIndex );
       
   514 		~CBuildIndex();
       
   515 		IMPORT_C static TInt Steps( TInt aCardinality );
       
   516 		inline CDbRecordIndex& Index();
       
   517 		IMPORT_C TInt StepsL();
       
   518 		// from CStepper
       
   519 		TInt StepL( TInt aStep );
       
   520 	private:
       
   521 		CBuildIndex();
       
   522 	private:
       
   523 		CDbTableSource* iSource;
       
   524 		TDbPosition iNext;
       
   525 		CDbRecordIndex* iIndex;
       
   526 		};
       
   527 protected:
       
   528 	IMPORT_C CDbTableDatabase();
       
   529 	IMPORT_C ~CDbTableDatabase();
       
   530 public:
       
   531 	inline RDbTransaction& Transaction();
       
   532 //
       
   533 	IMPORT_C CDbDatabase* InterfaceL();
       
   534 	IMPORT_C CDbSource* SourceL();
       
   535 //
       
   536 	inline RDbTableSchema& Schema();
       
   537 	IMPORT_C RDbTableSchema& SchemaL();
       
   538 //
       
   539 	CDbTableSource* TableSourceL( const TDesC& aTableName );
       
   540 	void Release( const CDbTableDef& aDef );
       
   541 // framework functions
       
   542 	virtual CStepper* TableAlterL( CDbTableDef& aTable, const HDbColumnSet& aNewSet, TInt& aStep ) = 0;
       
   543 	virtual CStepper* RecordDiscarderL( const CDbTableDef& aTable, TInt& aStep ) = 0;
       
   544 	virtual CStepper* IndexDiscarderL( const CDbTableDef& aTable, const CDbTableIndexDef& anIndex, TInt& aStep ) = 0;
       
   545 	IMPORT_C virtual CStepper* UtilityL( CDbDatabase::TUtility aType, TInt& aStep );
       
   546 protected:
       
   547 // framework
       
   548 	IMPORT_C virtual TInt Property( CDbDatabase::TProperty aProperty );
       
   549 private:
       
   550 //framework
       
   551 	virtual void AuthenticateL() = 0;
       
   552 	IMPORT_C virtual void Idle();
       
   553 	virtual void LoadSchemaL() = 0;
       
   554 	virtual void SynchL( TDbLockType aLock ) = 0;
       
   555 	virtual void Revert( TDbLockType aLock ) = 0;
       
   556 	virtual CDbTable* TableL( const CDbTableDef& aDef ) = 0;
       
   557 	virtual CDbTableDef* CreateTableL( const TDesC& aName, const CDbColSet& aColSet, const CDbKey* aPrimaryKey ) = 0;
       
   558 	virtual CDbTableIndexDef* CreateIndexL( const CDbTableDef& aTable, const TDesC& aName, const CDbKey& aKey ) = 0;
       
   559 	virtual void DestroyL() = 0;
       
   560 //
       
   561 	inline void Open();
       
   562 	void Close();
       
   563 	inline void AddTable( CDbTable& aTable );
       
   564 	void RemoveTable( CDbTable& aTable );
       
   565 //
       
   566 	void CheckIdle();
       
   567 	void FlushL( TDbLockType aLock );
       
   568 	void Abandon( TDbLockType aLock );
       
   569 	void Release();
       
   570 
       
   571 	void DoCreateTableL( const TDesC& aName, const CDbColSet& aColSet, const CDbKey* aPrimaryKey );
       
   572 	CIncremental* OpenCreateIndexL( const TDesC& aName, const TDesC& aTable, const CDbKey& aKey, TInt& aStep );
       
   573 	CIncremental* OpenDropIndexL( const TDesC& aName, const TDesC& aTable, TInt& aStep );
       
   574 	CIncremental* OpenDropTableL( const TDesC& aTable, TInt& aStep );
       
   575 	CIncremental* OpenAlterTableL( const TDesC& aTable, const CDbColSet& aNewDef, TInt& aStep );
       
   576 	CDbCursor* PrepareViewL( const TDbQuery& aQuery, const TDbWindow& aWindow, RDbRowSet::TAccess anAccess );
       
   577 	CDbCursor* PrepareTableL( const TDesC& aTable, RDbRowSet::TAccess anAccess );
       
   578 // reserved virtual function space
       
   579 	IMPORT_C virtual void Reserved_1();
       
   580 	IMPORT_C virtual void Reserved_2();
       
   581 private:
       
   582 	TInt iRef;
       
   583 	RDbCache iCache;
       
   584 	RDbTransaction iTransaction;
       
   585 	RDbTableSchema iSchema;
       
   586 	RDbTables iTables;
       
   587 	};
       
   588 
       
   589 #include "D32TABLE.INL"
       
   590 #endif