14#include "pqxx/compiler-public.hxx"
26#include "pqxx/strconv.hxx"
32#include <pqxx/internal/libpq-forward.hxx>
47 bool have_safe_strerror =
true;
53 bool safe_query_cancel =
true;
56 bool safe_result_copy =
true;
94template<typename ITER, typename ACCESS> inline
96 const
std::
string &sep,
105 for (++begin; begin != end; ++begin)
116template<
typename ITER>
inline std::string
118 {
return separated_list(sep, begin, end, [](ITER i){
return *i; }); }
122template<
typename CONTAINER>
inline auto
129 ->
typename std::enable_if<
131 not std::is_void<
decltype(std::begin(c))>::value
132 and not std::is_void<
decltype(std::end(c))>::value
146 typename std::enable_if<
147 (INDEX == std::tuple_size<TUPLE>::value-1),
153 const std::string & ,
158 return to_string(access(&std::get<INDEX>(t)));
165 typename std::enable_if<
166 (INDEX < std::tuple_size<TUPLE>::value-1),
171separated_list(
const std::string &sep,
const TUPLE &t,
const ACCESS& access)
176 separated_list<TUPLE, INDEX+1>(sep, t, access);
182 typename std::enable_if<
183 (INDEX <= std::tuple_size<TUPLE>::value),
190 return separated_list(sep, t, [](
const TUPLE &tup){
return *tup;});
207PQXX_LIBEXPORT
void freepqmem(
const void *)
noexcept;
213PQXX_LIBEXPORT
void freemallocmem(
const void *)
noexcept;
237 m_classname{Classname},
242 namedclass(
const std::string &Classname,
const std::string &Name) :
243 m_classname{Classname},
249 const std::string &
name() const noexcept {
return m_name; }
253 {
return m_classname; }
256 std::string description()
const;
259 std::string m_classname, m_name;
263PQXX_PRIVATE
void CheckUniqueRegistration(
264 const namedclass *New,
const namedclass *Old);
265PQXX_PRIVATE
void CheckUniqueUnregistration(
266 const namedclass *New,
const namedclass *Old);
273template<
typename GUEST>
281 GUEST *
get() const noexcept {
return m_guest; }
296 GUEST *m_guest =
nullptr;
304PQXX_LIBEXPORT
void sleep_seconds(
int);
The home of all libpqxx classes, functions, templates, etc.
Definition: array.hxx:26
thread_safety_model describe_thread_safety() noexcept
Describe thread safety available in this build.
Definition: util.cxx:31
std::string to_string(const field &Obj)
Convert a field to a string.
Definition: result.cxx:451
void ignore_unused(T)
Suppress compiler warning about an unused item.
Definition: util.hxx:38
std::string separated_list(const std::string &sep, ITER begin, ITER end, ACCESS access)
Represent sequence of values as a string, joined by a given separator.
Definition: util.hxx:95
constexpr oid oid_none
The "null" oid.
Definition: util.hxx:77
void freepqmem_templated(P *p) noexcept
Definition: util.hxx:208
void CheckUniqueUnregistration(const namedclass *New, const namedclass *Old)
Definition: util.cxx:88
void CheckUniqueRegistration(const namedclass *New, const namedclass *Old)
Definition: util.cxx:72
void freemallocmem(const void *) noexcept
Definition: util.cxx:112
void freepqmem(const void *) noexcept
Definition: util.cxx:106
void freemallocmem_templated(P *p) noexcept
Definition: util.hxx:214
Result set containing data returned by a query or command.
Definition: result.hxx:70
Descriptor of library's thread-safety model.
Definition: util.hxx:45
bool safe_libpq
Is the underlying libpq build thread-safe?
Definition: util.hxx:50
bool safe_kerberos
Is Kerberos thread-safe?
Definition: util.hxx:65
std::string description
A human-readable description of any thread-safety issues.
Definition: util.hxx:68
Helper base class: object descriptions for error messages and such.
Definition: util.hxx:234
const std::string & classname() const noexcept
Class name.
Definition: util.hxx:252
namedclass(const std::string &Classname, const std::string &Name)
Definition: util.hxx:242
namedclass(const std::string &Classname)
Definition: util.hxx:236
const std::string & name() const noexcept
Object name, or the empty string if no name was given.
Definition: util.hxx:249
Ensure proper opening/closing of GUEST objects related to a "host" object.
Definition: util.hxx:275
unique(const unique &)=delete
GUEST * get() const noexcept
Definition: util.hxx:281
void unregister_guest(GUEST *G)
Definition: util.hxx:289
void register_guest(GUEST *G)
Definition: util.hxx:283
unique & operator=(const unique &)=delete