libpqxx
The C++ client library for PostgreSQL
 
Loading...
Searching...
No Matches
callgate.hxx
1#ifndef PQXX_H_CALLGATE
2#define PQXX_H_CALLGATE
3
4/*
5Here's what a typical gate class definition looks like:
6
7```cxx
8#include <pqxx/internal/callgate.hxx>
9
10namespace pqxx::internal::gate
11{
12class 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
24namespace pqxx::internal
25{
27
54template<typename HOME> class PQXX_PRIVATE callgate
55{
56protected:
58 using super = callgate<HOME>;
60 using reference = HOME &;
61
62 callgate(reference x) : m_home(x) {}
63
65 reference home() const noexcept { return m_home; }
66
67private:
68 reference m_home;
69};
70} // namespace pqxx::internal
71
72#endif
reference home() const noexcept
The home object. The gate class has full "private" access.
Definition callgate.hxx:65
HOME & reference
A reference to the host class. Helps keep constructors easy.
Definition callgate.hxx:60
callgate< HOME > super
This class, to keep constructors easy.
Definition callgate.hxx:58
Internal items for libpqxx' own use. Do not use these yourself.
Definition encodings.cxx:33