Reference-counted smart pointer to libpq-allocated object. More...
#include <util.hxx>
Public Types | |
typedef T | content_type |
Public Member Functions | |
PQAlloc () PQXX_NOEXCEPT | |
PQAlloc (const PQAlloc &rhs) PQXX_NOEXCEPT | |
~PQAlloc () PQXX_NOEXCEPT | |
PQAlloc & | operator= (const PQAlloc &rhs) PQXX_NOEXCEPT |
PQAlloc (T *obj) PQXX_NOEXCEPT | |
Assume ownership of a pointer. | |
void | swap (PQAlloc &rhs) PQXX_NOEXCEPT |
operator bool () const PQXX_NOEXCEPT | |
Is this pointer non-null? | |
bool | operator! () const PQXX_NOEXCEPT |
Is this pointer null? | |
T * | operator-> () const |
Dereference pointer. | |
T & | operator* () const |
Dereference pointer. | |
T * | get () const PQXX_NOEXCEPT |
Obtain underlying pointer. | |
void | reset () PQXX_NOEXCEPT |
Reference-counted smart pointer to libpq-allocated object.
Keep track of a libpq-allocated object, and free it once all references to it have died.
The memory is freed with PQfreemem()
by default. This matters on Windows, where apparently under some circumstances, memory allocated by a DLL must be freed by the same DLL.
typedef T pqxx::internal::PQAlloc< T, DELETER >::content_type |
pqxx::internal::PQAlloc< T, DELETER >::PQAlloc | ( | ) |
pqxx::internal::PQAlloc< T, DELETER >::PQAlloc | ( | const PQAlloc< T, DELETER > & | rhs | ) |
pqxx::internal::PQAlloc< T, DELETER >::~PQAlloc | ( | ) |
pqxx::internal::PQAlloc< T, DELETER >::PQAlloc | ( | T * | obj | ) | [explicit] |
Assume ownership of a pointer.
T* pqxx::internal::PQAlloc< T, DELETER >::get | ( | ) | const |
Obtain underlying pointer.
Ownership of the pointer's memory remains with the PQAlloc object
Referenced by pqxx::encrypt_password(), pqxx::connection_base::esc_raw(), and pqxx::connection_base::quote_name().
pqxx::internal::PQAlloc< T, DELETER >::operator bool | ( | ) | const |
Is this pointer non-null?
bool pqxx::internal::PQAlloc< T, DELETER >::operator! | ( | ) | const |
Is this pointer null?
T& pqxx::internal::PQAlloc< T, DELETER >::operator* | ( | ) | const |
Dereference pointer.
Throws a logic_error if the pointer is null.
T* pqxx::internal::PQAlloc< T, DELETER >::operator-> | ( | ) | const |
Dereference pointer.
Throws a logic_error if the pointer is null.
Referenced by pqxx::internal::PQAlloc< const internal::result_data, internal::freemem_result_data >::operator*().
PQAlloc& pqxx::internal::PQAlloc< T, DELETER >::operator= | ( | const PQAlloc< T, DELETER > & | rhs | ) |
void pqxx::internal::PQAlloc< T, DELETER >::reset | ( | ) |
void pqxx::internal::PQAlloc< T, DELETER >::swap | ( | PQAlloc< T, DELETER > & | rhs | ) |
Referenced by pqxx::binarystring::swap().