You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
501 B
C
29 lines
501 B
C
|
4 years ago
|
#pragma once
|
||
|
|
|
||
|
|
#include <QtCore>
|
||
|
|
|
||
|
|
#include "lp_multi_base.h"
|
||
|
|
#include "db_con_poll_pri.h"
|
||
|
|
|
||
|
|
|
||
|
|
class LP_QT_UTILS_EXPORT lp_db_con_poll :
|
||
|
|
public QObject, public lp_multi_base<lp_db_con_poll>
|
||
|
|
{
|
||
|
|
Q_OBJECT
|
||
|
|
public:
|
||
|
|
lp_db_con_poll(const std::string& db_name);
|
||
|
|
~lp_db_con_poll();
|
||
|
|
|
||
|
|
void init(const LP_DB_CONFIG_NODE &config);
|
||
|
|
void close() override;
|
||
|
|
|
||
|
|
lp_db_con get_conn();
|
||
|
|
|
||
|
|
private:
|
||
|
|
QSharedPointer<lp_db_con_poll_pri> pool_{ nullptr };
|
||
|
|
|
||
|
|
QMutex mutex_;
|
||
|
|
std::string db_name_;
|
||
|
|
bool is_inited_{ false };
|
||
|
|
};
|