Thread-safe pool for leasing reusable SQLite connections.
More...
#include <connection_pool.hpp>
|
| | connection_pool (std::size_t capacity, connection_factory factory) |
| | Constructs a pool with a maximum capacity and a factory used to create new connections.
|
| lease | acquire () |
| | Blocks until a connection is available and returns a scoped lease.
|
| std::size_t | capacity () const |
| | Maximum number of concurrent connections the pool will create.
|
| std::size_t | idle_count () const |
| | Number of idle connections currently waiting in the pool.
|
| std::size_t | created_count () const |
| | Number of connections that have been created so far.
|
Thread-safe pool for leasing reusable SQLite connections.
Definition at line 55 of file connection_pool.hpp.
◆ connection_factory
◆ connection_pool()
| sqlite::v2::connection_pool::connection_pool |
( |
std::size_t | capacity, |
|
|
connection_factory | factory ) |
◆ acquire()
| lease sqlite::v2::connection_pool::acquire |
( |
| ) |
|
Blocks until a connection is available and returns a scoped lease.
◆ capacity()
| std::size_t sqlite::v2::connection_pool::capacity |
( |
| ) |
const |
Maximum number of concurrent connections the pool will create.
Referenced by connection_pool().
◆ created_count()
| std::size_t sqlite::v2::connection_pool::created_count |
( |
| ) |
const |
Number of connections that have been created so far.
◆ idle_count()
| std::size_t sqlite::v2::connection_pool::idle_count |
( |
| ) |
const |
Number of idle connections currently waiting in the pool.
◆ make_factory()
◆ release()
| void sqlite::v2::connection_pool::release |
( |
std::shared_ptr< connection > | conn | ) |
|
|
private |
◆ lease
◆ capacity_
| std::size_t sqlite::v2::connection_pool::capacity_ |
|
private |
◆ created_
| std::size_t sqlite::v2::connection_pool::created_ = 0 |
|
private |
◆ cv_
| std::condition_variable sqlite::v2::connection_pool::cv_ |
|
private |
◆ factory_
◆ idle_
| std::vector<std::shared_ptr<connection> > sqlite::v2::connection_pool::idle_ |
|
private |
◆ mutex_
| std::mutex sqlite::v2::connection_pool::mutex_ |
|
mutableprivate |
The documentation for this class was generated from the following file: