binary_plugin_router.h
Go to the documentation of this file.
1 //
2 // Created by nakakura on 22/08/25.
3 //
4 
5 #ifndef SKYWAY_PLUGIN_UDP_PIPE_BINARY_PLUGIN_ROUTER_H
6 #define SKYWAY_PLUGIN_UDP_PIPE_BINARY_PLUGIN_ROUTER_H
7 
8 #include <fruit/fruit.h>
10 #include <ros/ros.h>
11 
12 #include "../socket/udp_socket.h"
13 #include "plugin_router.h"
14 #include "skyway/skyway_plugin.h"
15 
16 using fruit::Component;
17 using fruit::createComponent;
18 using fruit::Injector;
19 
21  private:
24  std::vector<boost::shared_ptr<skyway_plugin::SkyWayBinaryPlugin>> plugins_;
25  udp::endpoint target_socket_;
26  std::unique_ptr<Socket> socket_;
27  std::shared_ptr<rapidjson::Document> config_;
28 
29  void observe_socket(std::vector<uint8_t> data);
30  void observe_plugins(std::vector<uint8_t> data);
31 
32  public:
33  BinaryPluginRouter() = delete;
34  INJECT(BinaryPluginRouter(ASSISTED(std::shared_ptr<rapidjson::Document>)
36  ASSISTED(udp::endpoint) target_socket,
39 
40  virtual PluginResult TryStart() override;
41  virtual uint16_t Port() override;
42 };
43 
44 struct BinaryAnnotation {};
45 
46 Component<fruit::Annotated<BinaryAnnotation, PluginRouterFactory>>
48 
49 #endif // SKYWAY_PLUGIN_UDP_PIPE_BINARY_PLUGIN_ROUTER_H
virtual uint16_t Port() override
void observe_plugins(std::vector< uint8_t > data)
Component< fruit::Annotated< BinaryAnnotation, PluginRouterFactory > > getBinaryPluginRouterComponent()
std::function< std::unique_ptr< Socket >(udp::endpoint, std::shared_ptr< std::function< void(std::vector< uint8_t >)> >)> SocketFactory
Definition: udp_socket.h:69
void observe_socket(std::vector< uint8_t > data)
pluginlib::ClassLoader< skyway_plugin::SkyWayBinaryPlugin > plugin_loader_
std::shared_ptr< rapidjson::Document > config_
std::unique_ptr< Socket > socket_
udp::endpoint target_socket_
virtual PluginResult TryStart() override
std::vector< boost::shared_ptr< skyway_plugin::SkyWayBinaryPlugin > > plugins_
ASSISTED(udp::endpoint) target_socket


skyway
Author(s): Toshiya Nakakura
autogenerated on Sat Apr 15 2023 02:08:21