-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_frame.h
69 lines (51 loc) · 2.09 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
63
64
65
66
67
68
69
/*
* main_frame.h
*
* Created on: 2013年8月21日
* Author: 1854
*/
#ifndef MAIN_FRAME_H_
#define MAIN_FRAME_H_
#include "lightframe.h"
#include "common/common_errordef.h"
#include "common/common_singleton.h"
#include "server_namespace.h"
#include "system_event.h"
FRAME_ROBOT_NAMESPACE_BEGIN
class CMainFrame : public CLightFrame
{
public:
CMainFrame();
virtual ~CMainFrame();
public:
//框架初始话
int32_t Initialize();
//恢复框架
int32_t Resume();
//销毁框架
int32_t Terminate();
void Run();
void Reload();
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__)
#define _WRITE_LOG(level, fmt, ...)\
do{ g_Frame.WriteUserLog("user_online_statistic_", level, __FILE__, __LINE__, ""fmt"\n", ##__VA_ARGS__); } while (false)
#define STATISTIC_WRITE_DEBUG_LOG(fmt, ...) _WRITE_LOG(enmLogLevel_Debug, fmt, ##__VA_ARGS__)
#define STATISTIC_WRITE_INFO_LOG(fmt, ...) _WRITE_LOG(enmLogLevel_Info, fmt, ##__VA_ARGS__)
#define STATISTIC_WRITE_NOTICE_LOG(fmt, ...) _WRITE_LOG(enmLogLevel_Notice, fmt, ##__VA_ARGS__)
#define STATISTIC_WRITE_WARNING_LOG(fmt, ...) _WRITE_LOG(enmLogLevel_Warning, fmt, ##__VA_ARGS__)
#define STATISTIC_WRITE_ERROR_LOG(fmt, ...) _WRITE_LOG(enmLogLevel_Error, fmt, ##__VA_ARGS__)
FRAME_ROBOT_NAMESPACE_END
#endif /* MAIN_FRAME_H_ */