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.7.0/src/memb/CVS/Entries | 5 +++++ ychat-0.7.7.0/src/memb/CVS/Repository | 1 + ychat-0.7.7.0/src/memb/CVS/Root | 1 + ychat-0.7.7.0/src/memb/memb.h | 23 ++++++++++++++++++++++ ychat-0.7.7.0/src/memb/memb.tmpl | 17 ++++++++++++++++ ychat-0.7.7.0/src/memb/tupel.h | 26 ++++++++++++++++++++++++ ychat-0.7.7.0/src/memb/tupel.tmpl | 37 +++++++++++++++++++++++++++++++++++ 7 files changed, 110 insertions(+) create mode 100644 ychat-0.7.7.0/src/memb/CVS/Entries create mode 100644 ychat-0.7.7.0/src/memb/CVS/Repository create mode 100644 ychat-0.7.7.0/src/memb/CVS/Root create mode 100644 ychat-0.7.7.0/src/memb/memb.h create mode 100644 ychat-0.7.7.0/src/memb/memb.tmpl create mode 100644 ychat-0.7.7.0/src/memb/tupel.h create mode 100644 ychat-0.7.7.0/src/memb/tupel.tmpl (limited to 'ychat-0.7.7.0/src/memb') diff --git a/ychat-0.7.7.0/src/memb/CVS/Entries b/ychat-0.7.7.0/src/memb/CVS/Entries new file mode 100644 index 0000000..ba3a2e5 --- /dev/null +++ b/ychat-0.7.7.0/src/memb/CVS/Entries @@ -0,0 +1,5 @@ +/memb.h/1.2/Mon Feb 21 01:55:49 2005// +/memb.tmpl/1.2/Mon Feb 21 01:55:49 2005// +/tupel.h/1.2/Mon Feb 21 01:55:49 2005// +/tupel.tmpl/1.2/Mon Feb 21 01:55:49 2005// +D diff --git a/ychat-0.7.7.0/src/memb/CVS/Repository b/ychat-0.7.7.0/src/memb/CVS/Repository new file mode 100644 index 0000000..cf42388 --- /dev/null +++ b/ychat-0.7.7.0/src/memb/CVS/Repository @@ -0,0 +1 @@ +ychat/src/memb diff --git a/ychat-0.7.7.0/src/memb/CVS/Root b/ychat-0.7.7.0/src/memb/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/ychat-0.7.7.0/src/memb/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/ychat-0.7.7.0/src/memb/memb.h b/ychat-0.7.7.0/src/memb/memb.h new file mode 100644 index 0000000..9c398ec --- /dev/null +++ b/ychat-0.7.7.0/src/memb/memb.h @@ -0,0 +1,23 @@ +#ifndef MEMB_H +#define MEMB_H + +#include "../incl.h" +#include "../maps/nhashmap.h" +#include "tupel.h" + +using namespace std; + +template +class memb +{ +private: + nhashmap< mutexed_tupel* > map_elems; + +public: + inline obj_type get_elem(string s_key); + inline void set_elem(obj_type t_obj, string s_key); + +}; + +#include "memb.tmpl" +#endif diff --git a/ychat-0.7.7.0/src/memb/memb.tmpl b/ychat-0.7.7.0/src/memb/memb.tmpl new file mode 100644 index 0000000..0b4da0e --- /dev/null +++ b/ychat-0.7.7.0/src/memb/memb.tmpl @@ -0,0 +1,17 @@ +template +obj_type +memb::get_elem(string s_key) +{ + mutexed_tupel *p_tupel = map_elems.get_elem(s_key); + if ( p_tupel ) + return p_tupel->get_elem(); + + return obj_type(); +} + +template +void +memb::set_elem(obj_type t_obj, string s_key) +{ + // mutexed_tupel *p_tupel = map_elems +} diff --git a/ychat-0.7.7.0/src/memb/tupel.h b/ychat-0.7.7.0/src/memb/tupel.h new file mode 100644 index 0000000..bb1939e --- /dev/null +++ b/ychat-0.7.7.0/src/memb/tupel.h @@ -0,0 +1,26 @@ +#ifndef TUPEL_H +#define TUPEL_H + +#include "../incl.h" + +#define mutexed_tupel tupel + +using namespace std; + +template +class tupel +{ +private: + pthread_mutex_t mut_tupel; + obj_type t_obj; +public: + tupel(); + tupel(obj_type t_obj); + ~tupel(); + + inline obj_type get_elem(); + inline void set_elem(obj_type t_obj); +}; + +#include "tupel.tmpl" +#endif diff --git a/ychat-0.7.7.0/src/memb/tupel.tmpl b/ychat-0.7.7.0/src/memb/tupel.tmpl new file mode 100644 index 0000000..bdde516 --- /dev/null +++ b/ychat-0.7.7.0/src/memb/tupel.tmpl @@ -0,0 +1,37 @@ +template +tupel::tupel() +{ + pthread_mutex_init( &mut_tupel, NULL ); +} + +template +tupel::tupel(obj_type t_obj) +{ + this->t_obj = t_obj; + pthread_mutex_init( &mut_tupel, NULL ); +} + +template +tupel::~tupel() +{ + pthread_mutex_destroy( &mut_tupel ); +} + +template +obj_type +tupel::get_elem() +{ + pthread_mutex_lock( &mut_tupel ); + obj_type t_ret = t_obj; + pthread_mutex_unlock( &mut_tupel ); + return t_ret; +} + +template +void +tupel::set_elem(obj_type t_obj) +{ + pthread_mutex_lock( &mut_tupel ); + this->t_obj = t_obj; + pthread_mutex_unlock( &mut_tupel ); +} -- cgit v1.2.3