metadataengine/server/inc/mdsdbconnectionpool.h
changeset 0 c53acadfccc6
equal deleted inserted replaced
-1:000000000000 0:c53acadfccc6
       
     1 /*
       
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  A pool of database connections
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __DBCONNECTIONPOOL_H__
       
    19 #define __DBCONNECTIONPOOL_H__
       
    20 
       
    21 #include <e32base.h>
       
    22 
       
    23 class CMdSSqLiteConnection;
       
    24 
       
    25 
       
    26 /**
       
    27  * A pool that handles interthread use of shared
       
    28  * database connections.
       
    29  * Current implementation uses only one shared
       
    30  * connection
       
    31  */
       
    32 class MMdSDbConnectionPool
       
    33     {
       
    34     public: // Constructors and destructor
       
    35 
       
    36         static void SetDefaultDB( CMdSSqLiteConnection* aConnection );
       
    37         static CMdSSqLiteConnection& GetDefaultDBL();
       
    38     private:
       
    39     	friend class CMdSMaintenanceEngine;
       
    40         static void DisconnectAll();
       
    41         static void ConnectAllL();
       
    42 
       
    43 
       
    44     private: // Member data
       
    45         
       
    46         static CMdSSqLiteConnection* iConnection;
       
    47         static TBool iDBValid;
       
    48     };
       
    49 
       
    50 
       
    51 #endif	// __DBCONNECTIONPOOL_H__
       
    52