00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "pqxx/compiler-public.hxx"
00020 #include "pqxx/compiler-internal-pre.hxx"
00021
00022 #include <string>
00023
00024 #include "pqxx/connection_base"
00025
00026 namespace pqxx
00027 {
00028
00029
00031
00045 template<typename CONNECTPOLICY> class basic_connection :
00046 public connection_base
00047 {
00048 public:
00049 basic_connection() :
00050 connection_base(m_policy),
00051 m_options(PGSTD::string()),
00052 m_policy(m_options)
00053 { init(); }
00054
00055 explicit basic_connection(const PGSTD::string &opt) :
00056 connection_base(m_policy), m_options(opt), m_policy(m_options) {init();}
00057
00058 explicit basic_connection(const char opt[]) :
00059 connection_base(m_policy),
00060 m_options(opt?opt:PGSTD::string()),
00061 m_policy(m_options)
00062 { init(); }
00063
00064 ~basic_connection() throw ()
00065 {
00066 #ifdef PQXX_QUIET_DESTRUCTORS
00067 PGSTD::auto_ptr<noticer> n(new nonnoticer);
00068 set_noticer(n);
00069 #endif
00070 close();
00071 }
00072
00073 const PGSTD::string &options() const throw ()
00074 {return m_policy.options();}
00075
00076 private:
00078 PGSTD::string m_options;
00080 CONNECTPOLICY m_policy;
00081 };
00082
00083 }
00084
00085 #include "pqxx/compiler-internal-post.hxx"
00086