libpqxx
The C++ client library for PostgreSQL
statement_parameters.hxx
Go to the documentation of this file.
1 
13 #ifndef PQXX_INTERNAL_STATEMENT_PARAMETERS_HXX
14 #define PQXX_INTERNAL_STATEMENT_PARAMETERS_HXX
15 
16 #include <cstring>
17 #include <iterator>
18 #include <string>
19 #include <vector>
20 
21 #include "pqxx/strconv.hxx"
22 #include "pqxx/util.hxx"
23 
24 
25 namespace pqxx::internal
26 {
27 template<typename ITERATOR>
28 constexpr inline auto const iterator_identity{
29  [](decltype(*std::declval<ITERATOR>()) x) { return x; }};
30 
31 
33 
44 {
45  c_params() = default;
47  c_params(c_params const &) = delete;
48  c_params(c_params &&) = default;
49  ~c_params() = default;
50 
51  c_params &operator=(c_params const &) = delete;
52  c_params &operator=(c_params &&) = default;
53 
55  void reserve(std::size_t n) &;
56 
57  // NOLINTBEGIN(misc-non-private-member-variables-in-classes)
58 
60  std::vector<char const *> values;
62  std::vector<int> lengths;
64  std::vector<int> formats;
65 
66  // NOLINTEND(misc-non-private-member-variables-in-classes)
67 };
68 } // namespace pqxx::internal
69 #endif
#define PQXX_LIBEXPORT
Definition: header-pre.hxx:206
Private namespace for libpqxx's internal use; do not access.
Definition: connection.cxx:333
constexpr auto const iterator_identity
Definition: statement_parameters.hxx:28
Internal type: encode statement parameters.
Definition: statement_parameters.hxx:44
c_params(c_params &&)=default
c_params(c_params const &)=delete
Copying these objects is pointless and expensive. Don't do it.
std::vector< int > lengths
As used by libpq: lengths of non-null arguments, in bytes.
Definition: statement_parameters.hxx:62
std::vector< char const * > values
As used by libpq: pointers to parameter values.
Definition: statement_parameters.hxx:60
std::vector< int > formats
As used by libpq: effectively boolean "is this a binary parameter?".
Definition: statement_parameters.hxx:64
c_params & operator=(c_params const &)=delete
c_params & operator=(c_params &&)=default