connection.hxx
#ifndef PQXX_H_CONNECTION
#define PQXX_H_CONNECTION
#include "pqxx/compiler-public.hxx"
#include "pqxx/compiler-internal-pre.hxx"
#include "pqxx/connectionpolicy.hxx"
#include "pqxx/basic_connection.hxx"
namespace pqxx
{
class PQXX_LIBEXPORT connect_direct : public connectionpolicy
{
public:
explicit connect_direct(const std::string &opts) : connectionpolicy{opts} {}
virtual handle do_startconnect(handle) override;
};
using connection = basic_connection_base<connect_direct>;
class PQXX_LIBEXPORT connect_lazy : public connectionpolicy
{
public:
explicit connect_lazy(const std::string &opts) : connectionpolicy{opts} {}
virtual handle do_completeconnect(handle) override;
};
using lazyconnection = basic_connection_base<connect_lazy>;
class PQXX_LIBEXPORT connect_async : public connectionpolicy
{
public:
explicit connect_async(const std::string &opts);
virtual handle do_startconnect(handle) override;
virtual handle do_completeconnect(handle) override;
virtual handle do_dropconnect(handle) noexcept override;
virtual bool is_ready(handle) const noexcept override;
private:
bool m_connecting;
};
using asyncconnection = basic_connection_base<connect_async>;
class PQXX_LIBEXPORT connect_null : public connectionpolicy
{
public:
explicit connect_null(const std::string &opts) : connectionpolicy{opts} {}
};
using nullconnection = basic_connection_base<connect_null>;
}
#include "pqxx/compiler-internal-post.hxx"
#endif
pqxx::connect_async::do_completeconnect
virtual handle do_completeconnect(handle) override
Definition: connection.cxx:129
pqxx::connectionpolicy::~connectionpolicy
virtual ~connectionpolicy() noexcept
Definition: connection.cxx:29
pqxx::connect_async
Asynchronous connection policy; connects "in the background".
Definition: connection.hxx:126
pqxx::connectionpolicy::normalconnect
handle normalconnect(handle)
Definition: connection.cxx:35
pqxx::basic_connection_base
Base-class template for all libpqxx connection types.
Definition: basic_connection.hxx:45
pqxx::connectionpolicy::connectionpolicy
connectionpolicy(const std::string &opts)
Definition: connection.cxx:23
pqxx::connectionpolicy::do_disconnect
virtual handle do_disconnect(handle orig) noexcept
Definition: connection.cxx:69
pqxx::connect_lazy::do_completeconnect
virtual handle do_completeconnect(handle) override
Definition: connection.cxx:99
pqxx::connect_direct::connect_direct
connect_direct(const std::string &opts)
Definition: connection.hxx:92
pqxx::connect_async::is_ready
virtual bool is_ready(handle) const noexcept override
Definition: connection.cxx:179
pqxx::internal::wait_write
void wait_write(const internal::pq::PGconn *)
Definition: connection_base.cxx:1304
pqxx::broken_connection
Exception class for lost or failed backend connection.
Definition: except.hxx:118
pqxx::connectionpolicy::handle
internal::pq::PGconn * handle
Definition: connectionpolicy.hxx:34
pqxx::connect_lazy::connect_lazy
connect_lazy(const std::string &opts)
Definition: connection.hxx:110
pqxx::connect_null::connect_null
connect_null(const std::string &opts)
Definition: connection.hxx:155
pqxx::connect_async::do_startconnect
virtual handle do_startconnect(handle) override
Definition: connection.cxx:112
pqxx::internal::wait_read
void wait_read(const internal::pq::PGconn *)
Definition: connection_base.cxx:1284
pqxx::connect_async::do_dropconnect
virtual handle do_dropconnect(handle) noexcept override
Definition: connection.cxx:172
pqxx::connect_direct::do_startconnect
virtual handle do_startconnect(handle) override
Definition: connection.cxx:84
pqxx::connect_lazy
Lazy connection policy; causes connection to be deferred until first use.
Definition: connection.hxx:105
pqxx::connectionpolicy::do_completeconnect
virtual handle do_completeconnect(handle orig)
Definition: connection.cxx:57
pqxx::connectionpolicy::is_ready
virtual bool is_ready(handle) const noexcept
Definition: connection.cxx:77
pqxx::connectionpolicy::do_dropconnect
virtual handle do_dropconnect(handle orig) noexcept
Definition: connection.cxx:63
pqxx::connect_null
Nonfunctional, always-down connection policy for testing/debugging purposes.
Definition: connection.hxx:152
pqxx
The home of all libpqxx classes, functions, templates, etc.
Definition: array.hxx:25
pqxx::connect_direct
Connection policy; creates an immediate connection to a database.
Definition: connection.hxx:87
pqxx::connectionpolicy::do_startconnect
virtual handle do_startconnect(handle orig)
Definition: connection.cxx:51
pqxx::connect_async::connect_async
connect_async(const std::string &opts)
Definition: connection.cxx:105
pqxx::connectionpolicy
Definition: connectionpolicy.hxx:31