0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-16 21:04:15 +08:00

Untab everything and improve formatting

This commit is contained in:
Frank Park 2017-04-11 14:15:38 -04:00
parent 1987614bfe
commit 628b0bbaff
2 changed files with 224 additions and 220 deletions

View File

@ -174,7 +174,8 @@ namespace sqlpp
connection_pool& operator=(const connection_pool&) = delete; connection_pool& operator=(const connection_pool&) = delete;
connection_pool& operator=(connection_pool&&) = delete; connection_pool& operator=(connection_pool&&) = delete;
pool_connection<Connection_config, Connection_validator, Connection> get_connection() auto get_connection()
-> pool_connection<Connection_config, Connection_validator, Connection>
{ {
std::lock_guard<std::mutex> lock(connection_pool_mutex); std::lock_guard<std::mutex> lock(connection_pool_mutex);
while (true) while (true)
@ -226,9 +227,8 @@ namespace sqlpp
template<typename Connection_config, template<typename Connection_config,
typename Connection_validator = connection_validator::automatic, typename Connection_validator = connection_validator::automatic,
typename Connection = typename std::enable_if<std::is_class<Connection_config::connection>::value, Connection_config::connection>::type> typename Connection = typename std::enable_if<std::is_class<Connection_config::connection>::value, Connection_config::connection>::type>
connection_pool<Connection_config, Connection_validator, Connection> make_connection_pool( auto make_connection_pool(const std::shared_ptr<Connection_config>& config, size_t max_pool_size)
const std::shared_ptr<Connection_config>& config, -> connection_pool<Connection_config, Connection_validator, Connection>
size_t max_pool_size)
{ {
return connection_pool<Connection_config, Connection_validator, Connection>(config, max_pool_size); return connection_pool<Connection_config, Connection_validator, Connection>(config, max_pool_size);
} }

View File

@ -41,10 +41,13 @@ namespace sqlpp
Connection_pool* origin; Connection_pool* origin;
public: public:
pool_connection() : _impl(nullptr), origin(nullptr) {} pool_connection() : _impl(nullptr), origin(nullptr)
{
}
pool_connection(std::unique_ptr<Connection>& connection, Connection_pool* origin) pool_connection(std::unique_ptr<Connection>& connection, Connection_pool* origin) : _impl(std::move(connection)), origin(origin)
: _impl(std::move(connection)), origin(origin) {} {
}
~pool_connection() ~pool_connection()
{ {
@ -79,8 +82,9 @@ namespace sqlpp
} }
pool_connection(const pool_connection&) = delete; pool_connection(const pool_connection&) = delete;
pool_connection(pool_connection&& other) pool_connection(pool_connection&& other) : _impl(std::move(other._impl)), origin(other.origin)
: _impl(std::move(other._impl)), origin(other.origin) {} {
}
pool_connection& operator=(const pool_connection&) = delete; pool_connection& operator=(const pool_connection&) = delete;
pool_connection& operator=(pool_connection&& other) pool_connection& operator=(pool_connection&& other)
{ {