db/zz_db_pool.h

Go to the documentation of this file.
00001 /* libzzdb
00002  *
00003  * This program is distributed under the GNU General Public License, version 2.
00004  * A copy of this license is included with this source.
00005  *
00006  * Copyright 2000-2006, Toni Thomsson <toni@tonjac.org> 
00007 */
00008 
00015 #ifndef zz_db_pool_h
00016 #define zz_db_pool_h
00017 
00018 #include <zz_string.h>
00019 #include <zz_db.h>
00020 #include <zz_db_exception.h>
00021 #include <map>
00022 
00023 class ZZ_API CzzDbPool
00024 {
00025 public:
00026 
00027     //* Construction
00028     CzzDbPool( const char* connect, int size, int autocommit = 1 );
00029     virtual ~CzzDbPool();
00030 
00031     CzzDb* getConnection( void );
00032     void freeConnection( CzzDb* connection );
00033 
00034 protected:
00035 private:
00036     CzzLog m_Log;
00037     CzzString m_Connect;
00038     int m_Size;
00039     map<int, CzzDb* > m_Pool;
00040     map<int, bool > m_Locktable;
00041     static CzzWinThreadMutex m_Mutex;
00042 };
00043 
00044 #endif // zz_db_pool_h

Generated on Thu Sep 21 21:45:42 2006 for tonjac.org MINI/C++ library by  doxygen 1.4.6-NO