blob: 29b5a0abe5cb9cdfbe62cd06bf994a4f32ced853 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#ifndef MMAN_H
#define MMAN_H
#include <mysql/mysql.h>
#include <string>
#include <vector>
#include "glob.h"
#include "mcon.h"
using namespace std;
class mman
{
private:
vector<MYSQL *> mysql;
string s_host;
string s_user;
string s_pass;
string s_db;
unsigned int i_port;
int i_initial_connections;
int i_max_connections;
int i_used_connections;
pthread_mutex_t mut_i_used_con;
public:
mman(int initial, int max);
~mman();
void init( string host, string user, string passwd, string db, unsigned int port = PRTMSQL );
MYSQL *get_connection();
MYSQL *new_connection( );
void free_connection( MYSQL *msql );
#ifdef NCURSES
void print_init_ncurses();
void print_used_connections( bool b_refresh );
#endif
};
#endif
|