summaryrefslogtreecommitdiff
path: root/s_mman.h
blob: e6e3ff4854630f671afda63a32771577fd3d5b66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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