libpqxx
connectionpolicy.hxx
1 
12 #ifndef PQXX_H_CONNECTIONPOLICY
13 #define PQXX_H_CONNECTIONPOLICY
14 
15 #include "pqxx/compiler-public.hxx"
16 #include "pqxx/compiler-internal-pre.hxx"
17 
18 #include <string>
19 
20 #include "pqxx/internal/libpq-forward.hxx"
21 
22 
23 namespace pqxx
24 {
25 
30 
31 class PQXX_LIBEXPORT connectionpolicy
32 {
33 public:
34  using handle = internal::pq::PGconn *;
35 
36  explicit connectionpolicy(const std::string &opts);
37  virtual ~connectionpolicy() noexcept;
38 
39  const std::string &options() const noexcept { return m_options; }
40 
41  virtual handle do_startconnect(handle orig);
42  virtual handle do_completeconnect(handle orig);
43  virtual handle do_dropconnect(handle orig) noexcept;
44  virtual handle do_disconnect(handle orig) noexcept;
45  virtual bool is_ready(handle) const noexcept;
46 
47 protected:
48  handle normalconnect(handle);
49 
50 private:
51  std::string m_options;
52 };
53 
55 } // namespace
56 
57 #include "pqxx/compiler-internal-post.hxx"
58 
59 #endif
Definition: connectionpolicy.hxx:31
The home of all libpqxx classes, functions, templates, etc.
Definition: array.hxx:22
internal::pq::PGconn * handle
Definition: connectionpolicy.hxx:34
STL namespace.