From 5a019f435eb0068b524566d9babf172d58d0e96e Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 6 Apr 2013 13:14:48 +0200 Subject: tagging ychat-0.7.9.2 --- src/maps/shashmap.h | 9 ++++++++- src/maps/shashmap.tmpl | 14 ++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'src/maps') diff --git a/src/maps/shashmap.h b/src/maps/shashmap.h index 6152ba2..99dd7c8 100644 --- a/src/maps/shashmap.h +++ b/src/maps/shashmap.h @@ -4,6 +4,8 @@ #include #include "hashmap.h" +#include "../monitor/dump.h" + using namespace std; template @@ -13,11 +15,15 @@ template class hash_type = size_hash, class alloc_type = compare_allocator > -class shashmap : protected hashmap +class shashmap : protected hashmap, + public dumpable { private: pthread_mutex_t mut_shashmap; +protected: + virtual void dumpit(); + public: explicit shashmap(); ~shashmap(); @@ -36,6 +42,7 @@ public: virtual inline vector* get_key_vector(); virtual inline void run_func( void (*func)(obj_type) ); virtual inline void run_func( void (*func)(obj_type, void*), void* v_arg ); + }; #include "shashmap.tmpl" diff --git a/src/maps/shashmap.tmpl b/src/maps/shashmap.tmpl index 4559284..c864d28 100644 --- a/src/maps/shashmap.tmpl +++ b/src/maps/shashmap.tmpl @@ -139,3 +139,17 @@ shashmap::run_func( void (*func)(obj hashmap::run_func(func, v_arg); pthread_mutex_unlock( &mut_shashmap ); } + +template +void +shashmap::dumpit() +{ + dumpable::add("[shashmap]"); + vector* p_vec = get_key_vector(); + + typename vector::iterator iter; + for (iter = p_vec->begin(); iter != p_vec->end(); ++iter) + dumpable::add(*iter); + + delete p_vec; +} -- cgit v1.2.3