ResourcePool.hh

00001 //********************************************************************
00002 //*** ResourcePool/oracle/ResourcePool.hh
00003 //*** Copyright (c) 2003-2009 by Markus Winand <mws@fatalmind.com>
00004 //*** $Id: ResourcePool.hh,v 1.30 2009-05-10 16:39:44 mws Exp $
00005 //********************************************************************
00006 /*
00007 This file is part of ResourcePool.
00008 
00009 ResourcePool is free software; you can redistribute it
00010 and/or modify it under the terms of the GNU General Public License
00011 as published by the Free Software Foundation; either version 2 of 
00012 the License, or (at your option) any later version.
00013 
00014 ResourcePool is distributed in the hope that it will be
00015 useful, but WITHOUT ANY WARRANTY; without even the implied warranty
00016 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 GNU General Public License for more details.
00018 
00019 You should have received a copy of the GNU General Public License
00020 along with ResourcePool; if not, write to the Free Software
00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00022 02111-1307  USA */
00023 
00024 #ifndef RESOURCEPOOL_ORACLE_RESOURCEPOOL_HH
00025 #define RESOURCEPOOL_ORACLE_RESOURCEPOOL_HH
00026 
00027 #ifndef RESOURCEPOOL_ORACLE_FACTORY_HH
00028 #include "ResourcePool/oracle/Factory.hh"
00029 #endif
00030 
00031 #ifndef RESOURCEPOOL_RESOURCEPOOL_HH
00032 #include "ResourcePool/ResourcePool.hh"
00033 #endif
00034 
00035 //#include "ResourcePool/BatchCommand.hh"
00036 #include "OptimizedBatchCommand.hh"
00037 #include "ResourcePool/IgnoreExceptionCommand.hh"
00038 
00039 #ifndef RESOURCEPOOL_ORACLE_SQLEXECUTE_HH
00040 #include "SQLExecute.hh"
00041 #endif
00042 
00043 #ifndef RESOURCEPOOL_ORACLE_SQLSELECT_HH
00044 #include "SQLSelect.hh"
00045 #endif
00046 
00047 #ifndef RESOURCEPOOL_ORACLE_SQLSELECTROW_HH
00048 #include "SQLSelectRow.hh"
00049 #endif
00050 
00051 #ifndef RESOURCEPOOL_ORACLE_TRANSACTION_HH
00052 #include "Transaction.hh"
00053 #endif
00054 
00055 #ifndef RESOURCEPOOL_ORACLE_ORACLEEXCEPTION_HH
00056 #include "OracleException.hh"
00057 #endif
00058 
00059 #ifndef RESOURCEPOOL_SQL_SQLException_HH
00060 #include "ResourcePool/SQL/SQLException.hh"
00061 #endif
00062 
00063 #ifndef INCLUDED_THREAD_LOCK_HH
00064 #include "Thread/Lock.hh"
00065 #endif
00066 
00067 #include "ResourceFwd.hh"
00068 
00069 namespace fatalmind {
00070 
00076 namespace oracle {
00077 
00078 template<class TM, template<class> class SLMDC>
00079 struct Commands;
00080 
00084 template<class TM, template<class>class SLMDC>
00085 class ResourceType
00086 : public PoolType<oracleFactory<TM, SLMDC>
00087     , oracleResource<TM>
00088     , oracleHandlesWithCache<TM>
00089     , Commands<TM, SLMDC>
00090     , TM>
00091 {
00092 };
00093 
00094 template<class TM, template<class> class SLMDC>
00095 struct Commands {
00096     Commands(const oracleFactory<TM, SLMDC>& f) {
00097     };
00098 
00099     typedef Command<fatalmind::oracle::ResourceType<TM, SLMDC> > Base;
00100     typedef fatalmind::oracle::SQLExecute<TM, SLMDC>   SQLExecute;
00101     typedef fatalmind::oracle::SQLSelect<TM, SLMDC>    SQLSelect;
00102     typedef fatalmind::oracle::SQLSelectRow<TM, SLMDC> SQLSelectRow;
00103     //typedef fatalmind::BatchCommand<Command<ResourceType<TM> > > SQLBatch;
00104     typedef fatalmind::oracle::OptimizedBatchCommand<Command<ResourceType<TM> > > SQLBatch;
00105     typedef fatalmind::IgnoreExceptionCommand<Command<ResourceType<TM> > > IgnoreException;
00106     typedef fatalmind::oracle::Transaction<TM, SLMDC>  Transaction;
00107 };
00108 
00109 } // namespace oracle
00110 
00111 namespace ResourceType {
00112 
00113 typedef oracle::ResourceType<DefaultThreadedModel, oracle::SelectListMetaDataNopCache> oracleNopCache;
00114 typedef oracle::ResourceType<DefaultThreadedModel, oracle::SelectListMetaDataCache> oracle;
00115 
00116 /*
00117 typedef oracle::ResourceType<SingleThreadedModel<>, oracle::SelectListMetaDataNopCache> oracleNopCacheST;
00118 typedef oracle::ResourceType<SingleThreadedModel<>, oracle::SelectListMetaDataCache> oracleST;
00119 
00120 typedef oracle::ResourceType<MultiThreadedModel<>, oracle::SelectListMetaDataNopCache> oracleNopCacheMT;
00121 typedef oracle::ResourceType<MultiThreadedModel<>, oracle::SelectListMetaDataCache> oracleMT;
00122 */
00123 
00124 } // namespace ResourceType
00125 } // namespace fatalmind
00126 
00127 //#include "Resource.hh"
00128 
00129 #endif
00130 

Generated on Mon Nov 9 16:21:24 2009 for ResourcePool by  doxygen 1.5.3