diff options
Diffstat (limited to 'ychat-0.1/base.h')
| -rw-r--r-- | ychat-0.1/base.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ychat-0.1/base.h b/ychat-0.1/base.h new file mode 100644 index 0000000..d1c37ba --- /dev/null +++ b/ychat-0.1/base.h @@ -0,0 +1,28 @@ +// template class data declaration; + +#ifndef BASE_H +#define BASE_H + +#include <vector> +#include "incl.h" +#include "name.h" + +class base +{ +private: + vector<name*> vec_elem ; + pthread_mutex_t mut_vec_elem; + +public: + base(); + ~base(); + + virtual void add_elem( name* p_name ); // add a element. + virtual bool del_elem( string &s_name ); // delete a alement. + virtual name* get_elem( string &s_name, bool &b_found ); // get a element. + + // execute func on all elements of vec_elem. v_pointer is the argument. + virtual void run_func( void (*func)(name*, void*), void* v_arg ); +}; + +#endif |
