5 #ifndef SKYWAY_PLUGIN_UDP_PIPE_JSON_PLUGIN_ROUTER_H
6 #define SKYWAY_PLUGIN_UDP_PIPE_JSON_PLUGIN_ROUTER_H
8 #include <fruit/fruit.h>
10 #include <rapidjson/document.h>
11 #include <rapidjson/error/en.h>
12 #include <rapidjson/stringbuffer.h>
13 #include <rapidjson/writer.h>
16 #include "../socket/udp_socket.h"
20 using namespace rapidjson;
21 using fruit::Component;
22 using fruit::createComponent;
23 using fruit::Injector;
28 std::vector<boost::shared_ptr<skyway_plugin::SkyWayJsonPlugin>>
plugins_;
31 std::shared_ptr<rapidjson::Document>
config_;
33 void observe_socket(std::vector<uint8_t> data);
34 void observe_plugins(std::shared_ptr<rapidjson::Document> document);
38 INJECT(
JsonPluginRouter(ASSISTED(std::shared_ptr<rapidjson::Document>) config,
39 ASSISTED(udp::endpoint) target_socket,
45 virtual uint16_t Port()
override;
50 Component<fruit::Annotated<JsonAnnotation, PluginRouterFactory>>
53 #endif // SKYWAY_PLUGIN_UDP_PIPE_JSON_PLUGIN_ROUTER_H