...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
(EXPERIMENTAL) A proxy to a connection owned by a pool that returns it to the pool when destroyed.
Defined in header <boost/mysql/connection_pool.hpp>
class pooled_connection
Name |
Description |
---|---|
Retrieves the connection owned by this object. |
|
Move assignment. |
|
Retrieves the connection owned by this object. |
|
pooled_connection [constructor] |
Constructs an invalid pooled connection. |
Returns the owned connection to the pool and marks it as not requiring reset. |
|
Returns whether the object owns a connection or not. |
|
~pooled_connection [destructor] |
Destructor. |
A pooled_connection
behaves
like to a std::unique_ptr
: it has exclusive ownership
of an any_connection
created by the pool.
When destroyed, it returns the connection to the pool. A pooled_connection
may own nothing. We say such a connection is invalid (this->valid() == false
).
This class is movable but not copyable.
While *this
is alive, the connection_pool
internal data will
be kept alive automatically. It's safe to destroy the connection_pool
object before *this
.
By default, individual connections created by the pool are not
thread-safe, even if the pool was created using pool_executor_params::thread_safe
.
Distinct objects: safe.
Shared objects: unsafe.
This part of the API is experimental, and may change in successive releases without previous notice.