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.7.0/src/data/data_base.h | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 ychat-0.7.0/src/data/data_base.h (limited to 'ychat-0.7.0/src/data/data_base.h') diff --git a/ychat-0.7.0/src/data/data_base.h b/ychat-0.7.0/src/data/data_base.h new file mode 100644 index 0000000..b38d978 --- /dev/null +++ b/ychat-0.7.0/src/data/data_base.h @@ -0,0 +1,45 @@ +#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: + map< string, 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 initialize_connections(); + virtual map_string select_user_data( string s_user, string s_query ); + virtual void insert_user_data( string s_user, string s_query, map_string insert_map ); + virtual void update_user_data( string s_user, string s_query, map_string update_map ); + void disconnect_all_connections(); + void check_data_con_timeout(); +}; + +#endif +#endif -- cgit v1.2.3