Reference-counted smart pointer to libpq-allocated object. More...
#include <util.hxx>
Public Types | |
typedef T | content_type |
Public Member Functions | |
PQAlloc () throw () | |
PQAlloc (const PQAlloc &rhs) throw () | |
PQAlloc (T *obj) throw () | |
Assume ownership of a pointer. More... | |
~PQAlloc () throw () | |
T * | get () const throw () |
Obtain underlying pointer. More... | |
operator bool () const throw () | |
Is this pointer non-null? More... | |
bool | operator! () const throw () |
Is this pointer null? More... | |
T & | operator* () const throw (PGSTD::logic_error) |
Dereference pointer. More... | |
T * | operator-> () const throw (PGSTD::logic_error) |
Dereference pointer. More... | |
PQAlloc & | operator= (const PQAlloc &rhs) throw () |
void | reset () throw () |
void | swap (PQAlloc &rhs) throw () |
Private Member Functions | |
void | loseref () throw () |
Free and reset current pointer (if any) More... | |
void | makeref (T *p) throw () |
void | makeref (const PQAlloc &rhs) throw () |
void | redoref (const PQAlloc &rhs) throw () |
void | redoref (T *obj) throw () |
Private Attributes | |
T * | m_Obj |
refcount | m_rc |
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 |
|
inline |
|
inline |
|
inline |
|
inlineexplicit |
Assume ownership of a pointer.
|
inline |
Obtain underlying pointer.
Ownership of the pointer's memory remains with the PQAlloc object
|
inlineprivate |
Free and reset current pointer (if any)
|
inlineprivate |
|
inlineprivate |
|
inline |
Is this pointer non-null?
|
inline |
Is this pointer null?
|
inline |
Dereference pointer.
Throws a logic_error if the pointer is null.
|
inline |
Dereference pointer.
Throws a logic_error if the pointer is null.
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inline |
|
inline |
|
private |
|
mutableprivate |