-
Notifications
You must be signed in to change notification settings - Fork 0
/
frame_configmgt.h
executable file
·75 lines (58 loc) · 1.85 KB
/
frame_configmgt.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
65
66
67
68
69
70
71
72
73
74
75
/*
* frame_configmgt.h
*
* Created on: 2011-11-22
* Author: jimm
*/
#ifndef FRAME_CONFIGMGT_H_
#define FRAME_CONFIGMGT_H_
#include "common/common_object.h"
#include "frame_logengine.h"
#include "lightframe_impl.h"
#include "frame_def.h"
#include "frame_baseconfig.h"
#include "frame_message_config.h"
#include "frame_namespace.h"
#include "frame_config_container.h"
FRAME_NAMESPACE_BEGIN
typedef struct tagUsrConfigCenter
{
int32_t nType;
char szName[enmMaxConfigCenterNameLength];
IConfigCenter* pConfigCenter;
}UsrConfigCenter;
class CFrameConfigMgt : public CObject
{
public:
CFrameConfigMgt();
virtual ~CFrameConfigMgt();
int32_t Initialize();
int32_t Resume();
int32_t Uinitialize();
//添加外部ConfigCenter
void AddUsrConfigCenter(int32_t nType, const char *szName, IConfigCenter* pConfigCenter);
//获取外部注册的ConfigCenter
IConfigCenter* GetUsrConfigCenter(const char *szName);
CFrameBaseConfig &GetFrameBaseConfig()
{
return m_stFrameBaseConfig.GetConfigObject();
}
CFrameMessageConfig &GetFrameMessageConfig()
{
return m_stFrameMessageConfig.GetConfigObject();
}
void MakeFrameBaseConfigFilePath(const char *szServerName)
{
m_stFrameBaseConfig.GetConfigObject().SetFrameBaseConfigFilePath(szServerName);
}
protected:
CFrameConfigContainer<CFrameBaseConfig> m_stFrameBaseConfig;
CFrameConfigContainer<CFrameMessageConfig> m_stFrameMessageConfig;
int32_t m_nUsrConfigCenterCount;
UsrConfigCenter m_arrUsrConfigCenter[enmMaxConfigCenterCount];
};
#define CREATE_FRAMECONFIGMGT_INSTANCE CSingleton<CFrameConfigMgt>::CreateInstance
#define g_FrameConfigMgt CSingleton<CFrameConfigMgt>::GetInstance()
#define DESTROY_FRAMECONFIGMGT_INSTANCE CSingleton<CFrameConfigMgt>::DestroyInstance
FRAME_NAMESPACE_END
#endif /* FRAME_CONFIGMGT_H_ */