pqxx::internal::PQAlloc< T > Class Template Reference
Reference-counted smart pointer to libpq-allocated object.
More...
#include <util.hxx>
Inheritance diagram for pqxx::internal::PQAlloc< T >:
[legend]Collaboration diagram for pqxx::internal::PQAlloc< T >:
[legend]List of all members.
Detailed Description
template<typename T>
class pqxx::internal::PQAlloc< T >
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.
If the available PostgreSQL development files supply PQfreemem() or PQfreeNotify(), this is used to free the memory. If not, free() is used instead. This matters on Windows, where memory allocated by a DLL must be freed by the same DLL.
- Warning:
- Copying, swapping, and destroying PQAlloc objects that refer to the same underlying libpq-allocated block is not thread-safe. If you wish to pass reference-counted objects around between threads, make sure that each of these operations is protected against concurrency with similar operations on the same object--or other copies of the same object.
Member Typedef Documentation
Constructor & Destructor Documentation
|
Assume ownership of a pointer.
- Warning:
- Don't to this more than once for a given object!
|
Member Function Documentation
|
Obtain underlying pointer.
Ownership of the pointer's memory remains with the PQAlloc object
Reimplemented in pqxx::binarystring. |
|
Dereference pointer.
Throws a logic_error if the pointer is null. |
|
Is this pointer non-null?
|
|
Dereference pointer.
Throws a logic_error if the pointer is null. |
The documentation for this class was generated from the following file:
Generated on Mon Oct 3 20:29:05 2005 for libpqxx by
1.4.2