connectionpolicy.hxx
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PQXX_H_CONNECTIONPOLICY
00020 #define PQXX_H_CONNECTIONPOLICY
00021
00022 #include "pqxx/compiler-public.hxx"
00023 #include "pqxx/compiler-internal-pre.hxx"
00024
00025 #include <string>
00026
00027 #include "pqxx/libpq-forward.hxx"
00028
00029
00030 namespace pqxx
00031 {
00032
00033
00038
00039 class PQXX_LIBEXPORT connectionpolicy
00040 {
00041 public:
00042 typedef internal::pq::PGconn *handle;
00043
00044 explicit connectionpolicy(const PGSTD::string &opts);
00045 virtual ~connectionpolicy() throw ();
00046
00047 const PGSTD::string &options() const throw () { return m_options; }
00048
00049 virtual handle do_startconnect(handle orig);
00050 virtual handle do_completeconnect(handle orig);
00051 virtual handle do_dropconnect(handle orig) throw ();
00052 virtual handle do_disconnect(handle orig) throw ();
00053 virtual bool is_ready(handle) const throw ();
00054
00055 protected:
00056 handle normalconnect(handle);
00057
00058 private:
00059 PGSTD::string m_options;
00060 };
00061
00063 }
00064
00065 #include "pqxx/compiler-internal-post.hxx"
00066
00067 #endif
00068