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