First public contribution.
1 // Copyright (c) 2008-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 SQLCOMPACTENTRY_H
17 #define SQLCOMPACTENTRY_H
19 #include "SqlCompact.h"
21 //Forward declarations
22 class CSqlCompactTestActive;
23 class CSqlCompactTimer;
25 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
26 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
29 #define SQLCOMPACTENTRY_INVARIANT() Invariant()
31 #define SQLCOMPACTENTRY_INVARIANT() void(0)
35 Every CSqlCompactEntry maintains a connection to the database that has to be compacted in background mode.
36 When the number of the free pages reaches or is above the threshold, the background compaction will be activated
37 and performed in steps.
44 NONSHARABLE_CLASS(CSqlCompactEntry) : public CBase
46 friend class CSqlCompactTestActive;
49 static CSqlCompactEntry* NewLC(const TDesC& aFullName, TSqlCompactConnFactoryL aConnFactoryL,
50 const TSqlCompactSettings& aSettings, CSqlCompactTimer& aTimer);
54 const TDesC& FullName() const;
55 void Invariant() const;
58 CSqlCompactEntry(const TSqlCompactSettings& aSettings, CSqlCompactTimer& aTimer);
59 virtual ~CSqlCompactEntry();
60 void ConstructL(const TDesC& aFullName, TSqlCompactConnFactoryL aConnFactoryL);
62 MSqlCompactConn& Connection();
63 static void FreePageCallback(void* aThis, TInt aFreePageCount);
70 TSqlCompactSettings iSettings;
71 CSqlCompactTimer& iTimer;
72 MSqlCompactConn* iConnection;
81 TBool iFreePageCallbackDisabled;
85 #endif//SQLCOMPACTENTRY_H