00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef RESOURCEPOOL_ORACLE_FACTORY_HH
00025 #define RESOURCEPOOL_ORACLE_FACTORY_HH
00026
00027 #ifndef RESOURCEPOOL_ORACLE_RESOURCEFWD_HH
00028 #include "ResourceFwd.hh"
00029 #endif
00030
00031 #ifndef RESOURCEPOOL_ORACLE_OCIENVHANDLEFWD_HH
00032 #include "OCIEnvHandleFwd.hh"
00033 #endif
00034
00035 #ifndef INCLUDED_GC_PTR_HH
00036 #include "mm/gc_ptr.hh"
00037 #endif
00038
00039 #include "ResourcePool/SQL/SQLFactoryInterface.hh"
00040
00041 #include <string>
00042 #include <memory>
00043
00044 namespace fatalmind {
00045
00051 template<class TM
00052 , template<class> class SLMDC = oracle::SelectListMetaDataCache
00053
00054 > class oracleFactory : public SQL::SQLFactoryInterface {
00055 typedef SQL::SQLFactoryInterface super;
00056 public:
00064 oracleFactory(const std::string& service_name
00065 , const std::string& user
00066 , const std::string& pass
00067 );
00071 oracleFactory(const std::string& logon);
00072 oracleFactory(const oracleFactory&);
00073 ~oracleFactory();
00074
00075 oracleResource<TM>* create_resource() const;
00076
00077 using super::databaseType_t;
00078 databaseType_t getDatabaseType() const {
00079 return OCI;
00080 };
00081
00082 protected:
00083 virtual Clone* DoClone() const;
00084
00085 private:
00086 std::string _service_name;
00087 std::string _user;
00088 std::string _pass;
00089
00090 const unsigned int _mode;
00091 mutable std::auto_ptr<oracle::OCIEnvHandle> _env;
00092 gc_ptr<typename oracle::SelectListMetaDataCacheInterface<TM>::type, TM> _slmdc;
00093 };
00094
00095 }
00096 #endif
00097