1 #ifndef SKYWAY_ROUTER_H
2 #define SKYWAY_ROUTER_H
4 #include <fruit/fruit.h>
5 #include <rapidjson/document.h>
6 #include <rapidjson/stringbuffer.h>
7 #include <rapidjson/writer.h>
15 using namespace rapidjson;
16 using fruit::Component;
17 using fruit::Injector;
21 virtual ~
Router() =
default;
23 virtual PluginResult OnConnectData(std::string target_ip,
25 std::string plugin_type,
26 std::string plugin_param) = 0;
32 std::string peer_id_ =
"";
33 std::string token_ =
"";
42 std::unordered_map<std::string, std::unique_ptr<PluginRouter>>
plugin_map_;
46 std::string on_control_message(std::string);
47 std::string on_event_request();
54 std::shared_ptr<IPluginRouterFactory> plugin_router_factory));
57 control_service_->Shutdown();
58 event_service_->Shutdown();
61 virtual void OnCreatePeer(
char* peer_id,
char* token)
override;
62 virtual PluginResult OnConnectData(std::string target_ip, uint16_t,
63 std::string, std::string)
override;
64 virtual void OnDeleteData(uint16_t port_num)
override;
69 #endif // SKYWAY_ROUTER_H