forked from MatsuriDayo/nekoray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProxyEntity.hpp
76 lines (53 loc) · 2.04 KB
/
ProxyEntity.hpp
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
76
#pragma once
#include "main/NekoGui.hpp"
#include "db/traffic/TrafficData.hpp"
#include "fmt/AbstractBean.hpp"
namespace NekoGui_fmt {
class SocksHttpBean;
class ShadowSocksBean;
class VMessBean;
class TrojanVLESSBean;
class NaiveBean;
class QUICBean;
class CustomBean;
class ChainBean;
}; // namespace NekoGui_fmt
namespace NekoGui {
class ProxyEntity : public JsonStore {
public:
QString type;
int id = -1;
int gid = 0;
int latency = 0;
std::shared_ptr<NekoGui_fmt::AbstractBean> bean;
std::shared_ptr<NekoGui_traffic::TrafficData> traffic_data = std::make_shared<NekoGui_traffic::TrafficData>("");
QString full_test_report;
ProxyEntity(NekoGui_fmt::AbstractBean *bean, const QString &type_);
[[nodiscard]] QString DisplayLatency() const;
[[nodiscard]] QColor DisplayLatencyColor() const;
[[nodiscard]] NekoGui_fmt::ChainBean *ChainBean() const {
return (NekoGui_fmt::ChainBean *) bean.get();
};
[[nodiscard]] NekoGui_fmt::SocksHttpBean *SocksHTTPBean() const {
return (NekoGui_fmt::SocksHttpBean *) bean.get();
};
[[nodiscard]] NekoGui_fmt::ShadowSocksBean *ShadowSocksBean() const {
return (NekoGui_fmt::ShadowSocksBean *) bean.get();
};
[[nodiscard]] NekoGui_fmt::VMessBean *VMessBean() const {
return (NekoGui_fmt::VMessBean *) bean.get();
};
[[nodiscard]] NekoGui_fmt::TrojanVLESSBean *TrojanVLESSBean() const {
return (NekoGui_fmt::TrojanVLESSBean *) bean.get();
};
[[nodiscard]] NekoGui_fmt::NaiveBean *NaiveBean() const {
return (NekoGui_fmt::NaiveBean *) bean.get();
};
[[nodiscard]] NekoGui_fmt::QUICBean *QUICBean() const {
return (NekoGui_fmt::QUICBean *) bean.get();
};
[[nodiscard]] NekoGui_fmt::CustomBean *CustomBean() const {
return (NekoGui_fmt::CustomBean *) bean.get();
};
};
} // namespace NekoGui