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.2/src/chat/gcol.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 ychat-0.7.2/src/chat/gcol.h (limited to 'ychat-0.7.2/src/chat/gcol.h') diff --git a/ychat-0.7.2/src/chat/gcol.h b/ychat-0.7.2/src/chat/gcol.h new file mode 100755 index 0000000..4936ded --- /dev/null +++ b/ychat-0.7.2/src/chat/gcol.h @@ -0,0 +1,42 @@ +// garbage collector +#include "../incl.h" + +#ifndef GCOL_H +#define GCOL_H + +#include +#include "room.h" +#include "user.h" +#include "../maps/smap.h" + +using namespace std; + +class gcol +{ + private: + vector vec_rooms; + smap* p_map_users; + + pthread_mutex_t mut_vec_rooms; + + static void delete_users_( user* user_obj ); + +#ifdef NCURSES + void print_garbage( ); +#endif + + public: + gcol(); + ~gcol(); + + bool remove_garbage(); + void add_room_to_garbage( room* p_room ); + void add_user_to_garbage( user* p_user ); + virtual room* get_room_from_garbage(); + virtual room* get_room_from_garbage_or_new( string s_room ); + user* get_user_from_garbage( string s_user ); + virtual void lock_mutex(); + virtual void unlock_mutex(); +}; + +#endif -- cgit v1.2.3