libpqxx
The C++ client library for PostgreSQL
result-field_ref.hxx
Go to the documentation of this file.
1 #ifndef PQXX_INTERNAL_GATES_RESULT_FIELD_REF_HXX
2 #define PQXX_INTERNAL_GATES_RESULT_FIELD_REF_HXX
3 
5 
6 namespace pqxx::internal::gate
7 {
8 class PQXX_PRIVATE result_field_ref final : callgate<result const>
9 {
10  friend class pqxx::field_ref;
11 
12  explicit constexpr result_field_ref(reference x) : super(x) {}
13 
14  [[nodiscard]] PQXX_PURE char const *
15  get_value(result_size_type row_num, row_size_type col_num) const noexcept
16  {
17  return home().get_value(row_num, col_num);
18  }
19 
20  [[nodiscard]] PQXX_PURE bool
21  get_is_null(result_size_type row_num, row_size_type col_num) const noexcept
22  {
23  return home().get_is_null(row_num, col_num);
24  }
25 
26  [[nodiscard]] PQXX_PURE field_size_type
27  get_length(result_size_type row_num, row_size_type col_num) const noexcept
28  {
29  return home().get_length(row_num, col_num);
30  }
31 
32  [[nodiscard]] oid column_type(row_size_type col_num, sl loc) const
33  {
34  return home().column_type(col_num, loc);
35  }
36 
37  [[nodiscard]] oid column_table(row_size_type col_num, sl loc) const
38  {
39  return home().column_table(col_num, loc);
40  }
41 
42  [[nodiscard]] encoding_group encoding() const noexcept
43  {
44  return home().m_encoding;
45  }
46 };
47 } // namespace pqxx::internal::gate
48 #endif
Lightweight reference to a field in a result set.
Definition: field.hxx:52
PQXX_PURE result const & home() const noexcept
Definition: field.hxx:70
Base class for call gates.
Definition: callgate.hxx:55
result const & reference
A reference to the host class. Helps keep constructors easy.
Definition: callgate.hxx:60
Definition: result-field_ref.hxx:9
oid column_table(row_size_type col_num, sl=sl::current()) const
What table did this column come from?
Definition: result.cxx:473
oid column_type(row_size_type col_num, sl=sl::current()) const
Return column's type, as an OID from the system catalogue.
Definition: result.cxx:449
#define PQXX_PURE
Definition: header-pre.hxx:64
#define PQXX_PRIVATE
Definition: header-pre.hxx:207
Definition: connection.hxx:94
int row_size_type
Number of fields in a row of database data.
Definition: types.hxx:83
std::source_location sl
Convenience alias for std::source_location. It's just too long.
Definition: types.hxx:38
std::size_t field_size_type
Number of bytes in a field of database data.
Definition: types.hxx:89
encoding_group
Definition: encoding_group.hxx:40
int result_size_type
Number of rows in a result set.
Definition: types.hxx:77
unsigned int oid
PostgreSQL database row identifier.
Definition: types.hxx:73