diff options
| author | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:42 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:42 +0200 |
| commit | 98eac951f8087b213f5850bd126dcb279db360a8 (patch) | |
| tree | c121f5c4df1aab847defa539990c1315bd5ba4a8 /mman.h | |
| parent | 0537da9d1e0f593130fc3967befb71e673b016bc (diff) | |
tagging ychat-0.6ychat-0.6
Diffstat (limited to 'mman.h')
| -rw-r--r-- | mman.h | 38 |
1 files changed, 38 insertions, 0 deletions
@@ -0,0 +1,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 |
