diff options
| author | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:42 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:42 +0200 |
| commit | 98eac951f8087b213f5850bd126dcb279db360a8 (patch) | |
| tree | c121f5c4df1aab847defa539990c1315bd5ba4a8 /s_mman.h | |
| parent | 0537da9d1e0f593130fc3967befb71e673b016bc (diff) | |
tagging ychat-0.6ychat-0.6
Diffstat (limited to 's_mman.h')
| -rw-r--r-- | s_mman.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/s_mman.h b/s_mman.h new file mode 100644 index 0000000..e6e3ff4 --- /dev/null +++ b/s_mman.h @@ -0,0 +1,38 @@ +#ifndef GMMAN_H +#define GMMAN_H + +#include "mman.h" +#include "s_conf.h" +#include "s_tool.h" + +using namespace std; + +class s_mman +{ +private: + static mman* obj; + +public: + static void init() + { + obj = new mman( s_tool::string2int(s_conf::get + ().get_val( "MIN_CONNECTIONS" )), s_tool::string2int(s_conf::get + ().get_val( "MAX_CONNECTIONS" ))); + obj->init( s_conf::get + ().get_val( "MYSQL_HOST" ), s_conf::get + ().get_val( "MYSQL_USER" ), s_conf::get + ().get_val( "MYSQL_PASS" ), + s_conf::get + ().get_val( "MYSQL_DB" ), s_tool::string2int(s_conf::get + ().get_val( "MYSQL_PORT" )) ); + } + + static mman& get + () + { + return *obj; + } +}; + + +#endif |
