From abf49b44cc47f39d6cceb83866f915bc03b7d900 Mon Sep 17 00:00:00 2001
From: Ferenc Szontágh <szf@fsociety.hu>
Date: Mon, 01 Jul 2024 18:08:34 +0000
Subject: [PATCH] reformat files
---
include/qtl_odbc_pool.hpp | 105 ++++++++++++++++++++++++++--------------------------
1 files changed, 53 insertions(+), 52 deletions(-)
diff --git a/include/qtl_odbc_pool.hpp b/include/qtl_odbc_pool.hpp
index eb5eb5e..dcfd82b 100644
--- a/include/qtl_odbc_pool.hpp
+++ b/include/qtl_odbc_pool.hpp
@@ -7,70 +7,71 @@
namespace qtl
{
-namespace odbc
-{
-
-class database_pool : public qtl::database_pool<database>
-{
-public:
- database_pool() { }
- virtual ~database_pool() { }
- virtual database* new_database() throw() override
+ namespace odbc
{
- database* db=NULL;
- try
- {
- db=new database(m_env);
- db->open(m_connection);
- }
- catch(error& e)
- {
- if(db)
- {
- delete db;
- db=NULL;
- }
- }
- return db;
- }
-protected:
- std::string m_connection;
- environment m_env;
-};
+ class database_pool : public qtl::database_pool<database>
+ {
+ public:
+ database_pool() {}
+ virtual ~database_pool() {}
+ virtual database *new_database() throw() override
+ {
+ database *db = NULL;
+ try
+ {
+ db = new database(m_env);
+ db->open(m_connection);
+ }
+ catch (error &e)
+ {
+ if (db)
+ {
+ delete db;
+ db = NULL;
+ }
+ }
+ return db;
+ }
+
+ protected:
+ std::string m_connection;
+ environment m_env;
+ };
#ifdef QTL_ODBC_ENABLE_ASYNC_MODE
-template<typename EventLoop>
-class async_pool : public qtl::async_pool<async_pool<EventLoop>, EventLoop, async_connection>
-{
- typedef qtl::async_pool<async_pool<EventLoop>, EventLoop, async_connection> base_class;
-public:
- async_pool(EventLoop& ev) : base_class(ev) { }
- virtual ~async_pool() { }
+ template <typename EventLoop>
+ class async_pool : public qtl::async_pool<async_pool<EventLoop>, EventLoop, async_connection>
+ {
+ typedef qtl::async_pool<async_pool<EventLoop>, EventLoop, async_connection> base_class;
- template<typename Handler>
- void new_connection(EventLoop& ev, Handler&& handler) throw()
- {
- async_connection* db = new async_connection(env);
- db->open(ev, [this, handler, db](const mysql::error& e) mutable {
+ public:
+ async_pool(EventLoop &ev) : base_class(ev) {}
+ virtual ~async_pool() {}
+
+ template <typename Handler>
+ void new_connection(EventLoop &ev, Handler &&handler) throw()
+ {
+ async_connection *db = new async_connection(env);
+ db->open(ev, [this, handler, db](const mysql::error &e) mutable
+ {
if (e)
{
delete db;
db = nullptr;
}
- handler(e, db);
- }, m_connection);
+ handler(e, db); }, m_connection);
+ }
+
+ protected:
+ std::string m_connection;
+ environment m_env;
+ };
+
+#endif // QTL_ODBC_ENABLE_ASYNC_MODE
+
}
-
-protected:
- std::string m_connection;
- environment m_env;
-};
-
-#endif //QTL_ODBC_ENABLE_ASYNC_MODE
-
-}
}
--
Gitblit v1.9.3