forked from chongtianfeiyu/account_agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
datacenter.h
executable file
·64 lines (45 loc) · 1.27 KB
/
datacenter.h
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* datacenter.h
*
* Created on: 2014年5月12日
* Author: jimm
*/
#ifndef DATACENTER_H_
#define DATACENTER_H_
#include "../common/common_singleton.h"
#include "../netevent/net_impl.h"
#include "../frame/frame.h"
#include "server_typedef.h"
#include "timer_handler.h"
#include "http_business/http_business.h"
#include "session_bank/session_mgt.h"
using namespace NETEVENT;
using namespace FRAME;
#include <map>
#include <string>
using namespace std;
typedef map<string, CMediaChannel *> SessionChannelMap;
class CDataCenter
{
public:
CDataCenter();
void SetFrame(CFrame *pFrame);
CFrame *GetFrame();
void SetTimerHandler(CTimerHandler *pTimerHandler);
CTimerHandler *GetTimerHandler();
void SetHttpBusiness(CHttpBusiness *pHttpBusiness);
CHttpBusiness *GetHttpBusiness();
void SetSessionMgt(CSessionMgt *pSessionMgt);
CSessionMgt *GetSessionMgt();
int32_t IncConnCount();
int32_t DecConnCount();
private:
CFrame *m_pFrame;
int32_t m_nConnCount;
SessionChannelMap m_stSessionChannelMap;
CTimerHandler *m_pTimerHandler;
CHttpBusiness *m_pHttpBusiness;
CSessionMgt *m_pSessionMgt;
};
#define g_DataCenter CSingleton<CDataCenter>::GetInstance()
#endif /* DATACENTER_H_ */