|
lintel 0.2.0
|
#include <ConnectionPool.h>
Public Member Functions | |
| Lease ()=default | |
| Lease (const Lease &)=delete | |
| Lease & | operator= (const Lease &)=delete |
| Lease (Lease &&other) noexcept | |
| Lease & | operator= (Lease &&other) noexcept |
| ~Lease () | |
| Connection & | connection () const |
| bool | valid () const |
Friends | |
| class | ConnectionPool |
RAII handle on a pooled connection.
Movable but not copyable: a lease belongs to the scope that acquired it and returns the connection on destruction (also while an exception unwinds). A lease that wanders out of its scope is a programming error, which is why copying is deleted; acquire() returns the lease by value through guaranteed copy elision.
|
default |
Construct an empty lease that holds no connection.
|
noexcept |
| other | lease to move from; other is emptied |
| lintel::db::ConnectionPool::Lease::~Lease | ( | ) |
Release the held connection back to the pool.
| Connection & lintel::db::ConnectionPool::Lease::connection | ( | ) | const |
| SQLException | if the lease is empty (moved-from or default-constructed) |
| other | lease to move from; a held connection is released first |
|
inline |
|
friend |