#include <mysql_pool.hpp>
|
| mysql_pool (const char *dbaddr, const char *dbname, const char *dbuser, const char *dbpass, int dblimit=64, unsigned long dbflags=0, bool auto_commit=true, int conn_timeout=60, int rw_timeout=60, const char *charset="utf8") |
|
| mysql_pool (const mysql_conf &conf) |
|
| ~mysql_pool () |
|
| db_pool (const char *dbaddr, size_t count, size_t idx=0) |
|
virtual | ~db_pool () |
|
db_handle * | peek_open () |
|
size_t | get_dblimit () const |
|
size_t | get_dbcount () const |
|
void | set_idle (int ttl) |
|
| connect_pool (const char *addr, size_t max, size_t idx=0) |
|
virtual | ~connect_pool () |
|
connect_pool & | set_timeout (int conn_timeout, int rw_timeout) |
|
connect_pool & | set_retry_inter (int retry_inter) |
|
connect_pool & | set_idle_ttl (time_t ttl) |
|
connect_pool & | set_check_inter (int n) |
|
connect_client * | peek (bool on=true) |
|
void | bind_one (connect_client *conn) |
|
void | put (connect_client *conn, bool keep=true) |
|
int | check_idle (time_t ttl, bool exclusive=true) |
|
void | set_alive (bool ok) |
|
bool | aliving () |
|
const char * | get_addr () const |
|
size_t | get_max () const |
|
size_t | get_count () const |
|
size_t | get_idx () const |
|
void | reset_statistics (int inter) |
|
unsigned long long | get_total_used () const |
|
unsigned long long | get_current_used () const |
|
void | set_key (const char *key) |
|
const char * | get_key (void) const |
|
◆ mysql_pool() [1/2]
acl::mysql_pool::mysql_pool |
( |
const char * |
dbaddr, |
|
|
const char * |
dbname, |
|
|
const char * |
dbuser, |
|
|
const char * |
dbpass, |
|
|
int |
dblimit = 64 , |
|
|
unsigned long |
dbflags = 0 , |
|
|
bool |
auto_commit = true , |
|
|
int |
conn_timeout = 60 , |
|
|
int |
rw_timeout = 60 , |
|
|
const char * |
charset = "utf8" |
|
) |
| |
采用 mysql 数据库时的构造函数
- 参数
-
dbaddr | {const char*} mysql 服务器地址,格式:IP:PORT, 在 UNIX 平台下可以为 UNIX 域套接口 |
dbname | {const char*} 数据库名 |
dbuser | {const char*} 数据库用户 |
dbpass | {const char*} 数据库用户密码 |
dblimit | {int} 数据库连接池的最大连接数限制 |
dbflags | {unsigned long} mysql 标记位 |
auto_commit | {bool} 是否自动提交 |
conn_timeout | {int} 连接数据库超时时间(秒) |
rw_timeout | {int} 与数据库通信时的IO时间(秒) |
charset | {const char*} 连接数据库的字符集(utf8, gbk, ...) |
◆ mysql_pool() [2/2]
acl::mysql_pool::mysql_pool |
( |
const mysql_conf & |
conf | ) |
|
◆ ~mysql_pool()
acl::mysql_pool::~mysql_pool |
( |
| ) |
|
◆ create_connect()
该类的文档由以下文件生成: