pqxx::internal Namespace Reference

Private namespace for libpqxx's internal use; do not access. More...

## Namespaces

| gate

## Classes

class | basic_robusttransaction
| Helper base class for the `robusttransaction` class template. More...
class | basic_transaction
| Helper base class for the `transaction` class template. More...
struct | builtin_traits
| Helper: string traits implementation for built-in types. More...
class | Escaper
class | namedclass
| Helper base class: object descriptions for error messages and such. More...
class | parameterized_invocation
| Helper class to construct an invocation of a parameterised statement. More...
class | reactivation_avoidance_counter
class | reactivation_avoidance_exemption
| Scoped exemption to reactivation avoidance. More...
class | transactionfocus
struct | type_name
| Give a human-readable name for a type, at compile time. More...
struct | type_name< char[N]>
class | TypedCopyEscaper
class | unique
| Ensure proper opening/closing of GUEST objects related to a "host" object. More...

## Functions

void | wait_read (const internal::pq::PGconn *)
void | wait_read (const internal::pq::PGconn *, long seconds, long microseconds)
void | wait_write (const internal::pq::PGconn *)
void | clear_result (const pq::PGresult *)
| C++ wrapper for libpq's PQclear. More...
void | throw_null_conversion (const std::string &type)
| Throw exception for attempt to convert null to given type. More...
| PQXX_DECLARE_TYPE_NAME (bool)
| PQXX_DECLARE_TYPE_NAME (short)
| PQXX_DECLARE_TYPE_NAME (unsigned short)
| PQXX_DECLARE_TYPE_NAME (int)
| PQXX_DECLARE_TYPE_NAME (unsigned int)
| PQXX_DECLARE_TYPE_NAME (long)
| PQXX_DECLARE_TYPE_NAME (unsigned long)
| PQXX_DECLARE_TYPE_NAME (long long)
| PQXX_DECLARE_TYPE_NAME (unsigned long long)
| PQXX_DECLARE_TYPE_NAME (float)
| PQXX_DECLARE_TYPE_NAME (double)
| PQXX_DECLARE_TYPE_NAME (long double)
| PQXX_DECLARE_TYPE_NAME (char *)
| PQXX_DECLARE_TYPE_NAME (const char *)
| PQXX_DECLARE_TYPE_NAME (std::string)
| PQXX_DECLARE_TYPE_NAME (std::stringstream)
constexpr int | digit_to_number (char c) noexcept
| Compute numeric value of given textual digit (assuming that it is a digit) More...
constexpr char | number_to_digit (int i) noexcept
std::string | escape (const std::string &s, const std::string &null)
std::string | escape_any (const std::string &s, const std::string &null)
std::string | escape_any (const char s[], const std::string &null)
template<typename T >
std::string | escape_any (const T &t, const std::string &null)
void | freepqmem (const void *) noexcept
template<typename P >
void | freepqmem_templated (P *p) noexcept
void | freemallocmem (const void *) noexcept
template<typename P >
void | freemallocmem_templated (P *p) noexcept
void | CheckUniqueRegistration (const namedclass *New, const namedclass *Old)
void | CheckUniqueUnregistration (const namedclass *New, const namedclass *Old)
void | sleep_seconds (int)
| Sleep for the given number of seconds. More...
template<int , int >
int | check_library_version () noexcept
| Library version check stub. More...
const char * | name_encoding (int encoding_id)
encoding_group | enc_group (int libpq_enc_id)
encoding_group | enc_group (const std::string &encoding_name)
template<template< encoding_group > class T, typename F >
F * | for_encoding (encoding_group enc)
| Look up instantiation `T<enc>::call` at runtime. More...
glyph_scanner_func * | get_glyph_scanner (encoding_group enc)
std::string::size_type | find_with_encoding (encoding_group enc, const std::string &haystack, char needle, std::string::size_type start)
std::string::size_type | find_with_encoding (encoding_group enc, const std::string &haystack, const std::string &needle, std::string::size_type start)
template<>
int | check_library_version< PQXX_VERSION_MAJOR, PQXX_VERSION_MINOR > () noexcept

## Detailed Description

Private namespace for libpqxx's internal use; do not access.

This namespace hides definitions internal to libpqxx. These are not supposed to be used by client programs, and they may change at any time without notice.

Conversely, if you find something in this namespace tremendously useful, by all means do lodge a request for its publication.

Warning
  Here be dragons!

## Function Documentation

## check_library_version()

template<int , int >

int pqxx::internal::check_library_version | ( |  | ) |

noexcept

Library version check stub.

Helps detect version mismatches between libpqxx headers and the libpqxx library binary.

Sometimes users run into trouble linking their code against libpqxx because they build their own libpqxx, but the system also has a different version installed. The declarations in the headers against which they compile their code will differ from the ones used to build the libpqxx version they're using, leading to confusing link errors. The solution is to generate a link error when the libpqxx binary is not the same version as the libpqxx headers used to compile the code.

This is a template declaration, but its only actual definition is a sepcialisation for the current library version. The definition is in the libpqxx binary, so it's based on the version as found in the binary. The headers contain a call to the function, specialised on the libpqxx version as found in the headers. (The library build process will use its own local headers even if another version of the headers is installed on the system.)

If the libpqxx binary was compiled for a different version than the user's code, linking will fail with an error: `check_library_version` will not exist for the given version number.

## check_library_version< PQXX_VERSION_MAJOR, PQXX_VERSION_MINOR >()

template<>

int pqxx::internal::check_library_version< PQXX_VERSION_MAJOR, PQXX_VERSION_MINOR > | ( |  | ) |

noexcept

## CheckUniqueRegistration()

void pqxx::internal::CheckUniqueRegistration | ( | const namedclass * | New,
|  | const namedclass * | Old
| ) |  |

References pqxx::internal::namedclass::description().

Referenced by pqxx::internal::unique< pqxx::transaction_base >::register_guest().

## CheckUniqueUnregistration()

void pqxx::internal::CheckUniqueUnregistration | ( | const namedclass * | New,
|  | const namedclass * | Old
| ) |  |

References pqxx::internal::namedclass::description().

Referenced by pqxx::internal::unique< pqxx::transaction_base >::unregister_guest().

## clear_result()

void pqxx::internal::clear_result | ( | const pq::PGresult * | data | ) |

C++ wrapper for libpq's PQclear.

## digit_to_number()

constexpr int pqxx::internal::digit_to_number | ( | char | c | ) |

constexpr noexcept

Compute numeric value of given textual digit (assuming that it is a digit)

## enc_group() [1/2]

encoding_group pqxx::internal::enc_group | ( | const std::string & | encoding_name | ) |

## enc_group() [2/2]

encoding_group pqxx::internal::enc_group | ( | int | libpq_enc_id | ) |

References name_encoding().

Referenced by pqxx::connection_base::esc_like().

## escape()

std::string pqxx::internal::escape | ( | const std::string & | s,
|  | const std::string & | null
| ) |  |

Referenced by escape_any(), and pqxx::internal::TypedCopyEscaper::operator()().

## escape_any() [1/3]

std::string pqxx::internal::escape_any | ( | const char | s[],
|  | const std::string & | null
| ) |  |

References escape().

## escape_any() [2/3]

std::string pqxx::internal::escape_any | ( | const std::string & | s,
|  | const std::string & | null
| ) |  |

References escape().

Referenced by pqxx::internal::Escaper< IT >::operator()().

## escape_any() [3/3]

template<typename T >

std::string pqxx::internal::escape_any | ( | const T & | t,
|  | const std::string & | null
| ) |  |

References escape(), and pqxx::to_string().

## find_with_encoding() [1/2]

std::string::size_type pqxx::internal::find_with_encoding | ( | encoding_group | enc,
|  | const std::string & | haystack,
|  | char | needle,
|  | std::string::size_type | start
| ) |  |

## find_with_encoding() [2/2]

std::string::size_type pqxx::internal::find_with_encoding | ( | encoding_group | enc,
|  | const std::string & | haystack,
|  | const std::string & | needle,
|  | std::string::size_type | start
| ) |  |

## for_encoding()

template<template< encoding_group > class T, typename F >

F* pqxx::internal::for_encoding | ( | encoding_group | enc | ) |

Look up instantiation `T<enc>::call` at runtime.

Here, "T" is a struct template with a static member function "call", whose type is "F".

The return value is a pointer to the "call" member function for the instantiation of T for encoding group enc.

References pqxx::to_string().

## freemallocmem()

void pqxx::internal::freemallocmem | ( | const void * | p | ) |

noexcept

Referenced by freemallocmem_templated().

## freemallocmem_templated()

template<typename P >

void pqxx::internal::freemallocmem_templated | ( | P * | p | ) |

noexcept

References freemallocmem(), and freemallocmem_templated().

Referenced by freemallocmem_templated().

## freepqmem()

void pqxx::internal::freepqmem | ( | const void * | p | ) |

noexcept

Referenced by freepqmem_templated(), and pqxx::connection_base::unesc_raw().

## freepqmem_templated()

template<typename P >

void pqxx::internal::freepqmem_templated | ( | P * | p | ) |

noexcept

References freepqmem(), and freepqmem_templated().

Referenced by freepqmem_templated().

## get_glyph_scanner()

glyph_scanner_func* pqxx::internal::get_glyph_scanner | ( | encoding_group | enc | ) |

## name_encoding()

const char* pqxx::internal::name_encoding | ( | int | encoding_id | ) |

Referenced by enc_group(), and pqxx::connection_base::get_client_encoding().

## number_to_digit()

constexpr char pqxx::internal::number_to_digit | ( | int | i | ) |

constexpr noexcept

## PQXX_DECLARE_TYPE_NAME() [1/16]

pqxx::internal::PQXX_DECLARE_TYPE_NAME | ( | bool |  | ) |

## PQXX_DECLARE_TYPE_NAME() [2/16]

pqxx::internal::PQXX_DECLARE_TYPE_NAME | ( | char * |  | ) |

## PQXX_DECLARE_TYPE_NAME() [3/16]

pqxx::internal::PQXX_DECLARE_TYPE_NAME | ( | const char * |  | ) |

## PQXX_DECLARE_TYPE_NAME() [4/16]

pqxx::internal::PQXX_DECLARE_TYPE_NAME | ( | double |  | ) |

## PQXX_DECLARE_TYPE_NAME() [5/16]

pqxx::internal::PQXX_DECLARE_TYPE_NAME | ( | float |  | ) |

## PQXX_DECLARE_TYPE_NAME() [6/16]

pqxx::internal::PQXX_DECLARE_TYPE_NAME | ( | int |  | ) |

## PQXX_DECLARE_TYPE_NAME() [7/16]

pqxx::internal::PQXX_DECLARE_TYPE_NAME | ( | long double |  | ) |

## PQXX_DECLARE_TYPE_NAME() [8/16]

pqxx::internal::PQXX_DECLARE_TYPE_NAME | ( | long long |  | ) |

## PQXX_DECLARE_TYPE_NAME() [9/16]

pqxx::internal::PQXX_DECLARE_TYPE_NAME | ( | long |  | ) |

## PQXX_DECLARE_TYPE_NAME() [10/16]

pqxx::internal::PQXX_DECLARE_TYPE_NAME | ( | short |  | ) |

## PQXX_DECLARE_TYPE_NAME() [11/16]

pqxx::internal::PQXX_DECLARE_TYPE_NAME | ( | std::string |  | ) |

## PQXX_DECLARE_TYPE_NAME() [12/16]

pqxx::internal::PQXX_DECLARE_TYPE_NAME | ( | std::stringstream |  | ) |

## PQXX_DECLARE_TYPE_NAME() [13/16]

pqxx::internal::PQXX_DECLARE_TYPE_NAME | ( | unsigned int |  | ) |

## PQXX_DECLARE_TYPE_NAME() [14/16]

pqxx::internal::PQXX_DECLARE_TYPE_NAME | ( | unsigned long long |  | ) |

## PQXX_DECLARE_TYPE_NAME() [15/16]

pqxx::internal::PQXX_DECLARE_TYPE_NAME | ( | unsigned long |  | ) |

## PQXX_DECLARE_TYPE_NAME() [16/16]

pqxx::internal::PQXX_DECLARE_TYPE_NAME | ( | unsigned short |  | ) |

## sleep_seconds()

void pqxx::internal::sleep_seconds | ( | int | s | ) |

Sleep for the given number of seconds.

May return early, e.g. when interrupted by a signal. Completes instantly if a zero or negative sleep time is requested.

## throw_null_conversion()

void pqxx::internal::throw_null_conversion | ( | const std::string & | type | ) |

Throw exception for attempt to convert null to given type.

Referenced by pqxx::internal::builtin_traits< TYPE >::null(), pqxx::enum_traits< ENUM >::null(), pqxx::string_traits< std::string >::null(), pqxx::string_traits< const std::string >::null(), and pqxx::string_traits< std::stringstream >::null().

## wait_read() [1/2]

void pqxx::internal::wait_read | ( | const internal::pq::PGconn * | c | ) |

Referenced by pqxx::connection_base::await_notification(), pqxx::connect_async::do_completeconnect(), and pqxx::connection_base::wait_read().

## wait_read() [2/2]

void pqxx::internal::wait_read | ( | const internal::pq::PGconn * | c,
|  | long | seconds,
|  | long | microseconds
| ) |  |

## wait_write()

void pqxx::internal::wait_write | ( | const internal::pq::PGconn * | c | ) |

Referenced by pqxx::connect_async::do_completeconnect(), and pqxx::connection_base::wait_write().