libpqxx
The C++ client library for PostgreSQL
callgate.hxx
1 #ifndef PQXX_H_CALLGATE
2 #define PQXX_H_CALLGATE
3 
4 /*
5 Here's what a typical gate class definition looks like:
6 
7 ```cxx
8 #include <pqxx/internal/callgate.hxx>
9 
10 namespace pqxx::internal::gate
11 {
12 class PQXX_PRIVATE @gateclass@ : callgate<@host@>
13 {
14  friend class @client@;
15 
16  @gateclass@(reference x) : super(x) {}
17 
18  // Methods here. Use home() to access the host-class object.
19 };
20 } // namespace pqxx::internal::gate
21 ```
22 */
23 
24 namespace pqxx::internal
25 {
27 
54 template<typename HOME> class PQXX_PRIVATE callgate
55 {
56 protected:
60  using reference = HOME &;
61 
62  callgate(reference x) : m_home(x) {}
63 
65  reference home() const noexcept { return m_home; }
66 
67 private:
68  reference m_home;
69 };
70 } // namespace pqxx::internal
71 
72 #endif
Internal items for libpqxx' own use. Do not use these yourself.
Definition: encodings.cxx:32
reference home() const noexcept
The home object. The gate class has full "private" access.
Definition: callgate.hxx:65
Base class for call gates.
Definition: callgate.hxx:54
Interface definition (and common code) for "transaction" classes.
Definition: transaction_base.hxx:150