forked from tomdev2008/gateserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_frame.h
executable file
·62 lines (45 loc) · 1.5 KB
/
main_frame.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
/*
* main_frame.h
*
* Created on: 2011-12-12
* Author: luocj
*/
#ifndef MAIN_FRAME_H_
#define MAIN_FRAME_H_
#include "common/common_errordef.h"
#include "common/common_singleton.h"
#include "def/server_namespace.h"
#include "frame_logengine.h"
#include "lightframe.h"
FRAME_GATESERVER_NAMESPACE_BEGIN
class CMainFrame : public CLightFrame
{
public:
CMainFrame();
virtual ~CMainFrame();
public:
//框架初始话
int32_t Initialize();
//恢复框架
int32_t Resume();
//销毁框架
int32_t Terminate();
void Run();
void Reload();
void OnTestRequest();
protected:
void RegistMsg();
};
#define CREATE_MAINFRAME_INSTANCE CSingleton<CMainFrame>::CreateInstance
#define GET_MAINFRAME_INSTANCE CSingleton<CMainFrame>::GetInstance
#define DESTROY_MAINFRAME_INSTANCE CSingleton<CMainFrame>::DestroyInstance
#define g_Frame GET_MAINFRAME_INSTANCE()
#define WRITE_LOG(level, fmt, ...) \
do{ g_Frame.WriteLog(level, __FILE__, __LINE__,""fmt"\n", ##__VA_ARGS__); } while (false)
#define WRITE_DEBUG_LOG(fmt, ...) WRITE_LOG(enmLogLevel_Debug, fmt, ##__VA_ARGS__)
#define WRITE_INFO_LOG(fmt, ...) WRITE_LOG(enmLogLevel_Info, fmt, ##__VA_ARGS__)
#define WRITE_NOTICE_LOG(fmt, ...) WRITE_LOG(enmLogLevel_Notice, fmt, ##__VA_ARGS__)
#define WRITE_WARNING_LOG(fmt, ...) WRITE_LOG(enmLogLevel_Warning, fmt, ##__VA_ARGS__)
#define WRITE_ERROR_LOG(fmt, ...) WRITE_LOG(enmLogLevel_Error, fmt, ##__VA_ARGS__)
FRAME_GATESERVER_NAMESPACE_END
#endif /* MAIN_FRAME_H_ */