-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfigs.h
68 lines (48 loc) · 1.49 KB
/
configs.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
#ifndef CONFIGS_H
#define CONFIGS_H
// 一些通用的设置
const int DEF_RESOLVE_MAX_IPs = 30; // resolve 最多解析得到的 IP 数
const int DEF_TRACE_MAX_HOPs = 100; // trace 最大跳站数
const unsigned long DEF_TRACE_TIMEOUT_MAX = 10000; // trace 最大超时时间
const unsigned long DEF_TRACE_THREAD_INTERVAL_MAX = 3000; // 每个线程的最大启动延迟
// 一些预定义的枚举
enum ConfigLogLevel {
ConfigLogLevelDebug,
ConfigLogLevelInfo,
ConfigLogLevelWarning,
ConfigLogLevelCritical
};
enum ConfigResolveDoubleClickAction {
ConfigResolveDoubleClickActionStartTrace,
ConfigResolveDoubleClickActionOpenMap
};
class Configs
{
public:
Configs();
void Save();
int GetLogLevel();
void SetLogLevel(int);
int GetTraceMaxHops();
void SetTraceMaxHops(int);
unsigned long GetTraceTimeout();
void SetTraceTimeout(unsigned long);
unsigned long GetTraceThreadInterval();
void SetTraceThreadInterval(unsigned long);
bool GetAutoOpenMap();
void SetAutoOpenMap(bool);
bool GetAutoStartTrace();
void SetAutoStartTrace(bool);
int GetResolveDoubleClickAction();
void SetResolveDoubleClickAction(int);
private:
int logLevel;
int traceMaxHops;
unsigned long traceTimeout;
unsigned long traceThreadInterval;
bool autoOpenMap;
bool autoStartTrace;
int resolveDoubleClickAction;
};
extern Configs * gCfg;
#endif // CONFIGS_H