From 9cd3ccffd5372dfde3af478e3f832f18db4be3f1 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 6 Apr 2013 13:14:41 +0200 Subject: tagging tags --- ychat-0.8.0/src/data/data_base.h | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 ychat-0.8.0/src/data/data_base.h (limited to 'ychat-0.8.0/src/data/data_base.h') diff --git a/ychat-0.8.0/src/data/data_base.h b/ychat-0.8.0/src/data/data_base.h new file mode 100644 index 0000000..79f5630 --- /dev/null +++ b/ychat-0.8.0/src/data/data_base.h @@ -0,0 +1,48 @@ +#include "../incl.h" +#ifdef DATABASE + +#ifndef DATA_BASE_H +#define DATA_BASE_H + +#include +#include +#include "con.h" + +using namespace std; + +class data_base : protected list +{ +private: + pthread_mutex_t mut_con; + int i_max_con; + +#ifdef NCURSES + + void print_queue_size(); +#endif + +protected: + hashmap< vector > map_queries; + void print_query( string s_query ); +#ifdef DATA_PRINT_QUERIES + + virtual void print_query_( string s_query ); +#endif + + con* get_con(); + void push_con( con* p_con ); + +public: + data_base(); + ~data_base(); + + void init_connections(); + virtual hashmap select_user_data( string s_user, string s_query ); + virtual void insert_user_data( string s_user, string s_query, hashmap insert_map ); + virtual void update_user_data( string s_user, string s_query, hashmap update_map ); + void disconnect_all_connections(); + void check_data_con_timeout(); +}; + +#endif +#endif -- cgit v1.2.3