connection.hxx
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PQXX_H_CONNECTION
00020 #define PQXX_H_CONNECTION
00021
00022 #include "pqxx/compiler-public.hxx"
00023 #include "pqxx/compiler-internal-pre.hxx"
00024
00025 #include "pqxx/connectionpolicy"
00026 #include "pqxx/basic_connection"
00027
00028 namespace pqxx
00029 {
00030
00073
00074
00084 class PQXX_LIBEXPORT connect_direct : public connectionpolicy
00085 {
00086 public:
00087 explicit connect_direct(const std::string &opts) : connectionpolicy(opts) {}
00088 virtual handle do_startconnect(handle) PQXX_OVERRIDE;
00089 };
00090
00092 typedef basic_connection<connect_direct> connection;
00093
00094
00096
00100 class PQXX_LIBEXPORT connect_lazy : public connectionpolicy
00101 {
00102 public:
00103 explicit connect_lazy(const std::string &opts) : connectionpolicy(opts) {}
00104 virtual handle do_completeconnect(handle) PQXX_OVERRIDE;
00105 };
00106
00107
00109 typedef basic_connection<connect_lazy> lazyconnection;
00110
00111
00113
00119 class PQXX_LIBEXPORT connect_async : public connectionpolicy
00120 {
00121 public:
00122 explicit connect_async(const std::string &opts);
00123 virtual handle do_startconnect(handle) PQXX_OVERRIDE;
00124 virtual handle do_completeconnect(handle) PQXX_OVERRIDE;
00125 virtual handle do_dropconnect(handle) PQXX_NOEXCEPT PQXX_OVERRIDE;
00126 virtual bool is_ready(handle) const PQXX_NOEXCEPT PQXX_OVERRIDE;
00127
00128 private:
00130 bool m_connecting;
00131 };
00132
00133
00135 typedef basic_connection<connect_async> asyncconnection;
00136
00137
00139
00143 class PQXX_LIBEXPORT connect_null : public connectionpolicy
00144 {
00145 public:
00146 explicit connect_null(const std::string &opts) : connectionpolicy(opts) {}
00147 };
00148
00149
00151 typedef basic_connection<connect_null> nullconnection;
00152
00157 }
00158
00159 #include "pqxx/compiler-internal-post.hxx"
00160
00161 #endif
00162