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
BinaryPluginRouter::plugins_
std::vector< boost::shared_ptr< skyway_plugin::SkyWayBinaryPlugin > > plugins_
Definition: binary_plugin_router.h:24
class_loader.h
BinaryPluginRouter::BinaryPluginRouter
BinaryPluginRouter()=delete
Definition: binary_plugin_router.cpp:19
BinaryPluginRouter::ASSISTED
ASSISTED(udp::endpoint) target_socket
ros.h
BinaryPluginRouter::Port
virtual uint16_t Port() override
Definition: binary_plugin_router.cpp:84
BinaryPluginRouter::config_
std::shared_ptr< rapidjson::Document > config_
Definition: binary_plugin_router.h:27
PluginRouter
Definition: plugin_router.h:20
BinaryPluginRouter::factory
SocketFactory factory
Definition: binary_plugin_router.h:37
BinaryPluginRouter::~BinaryPluginRouter
~BinaryPluginRouter()
Definition: binary_plugin_router.cpp:32
BinaryAnnotation
Definition: binary_plugin_router.h:44
BinaryPluginRouter::observe_plugins
void observe_plugins(std::vector< uint8_t > data)
Definition: binary_plugin_router.cpp:14
BinaryPluginRouter::observe_socket
void observe_socket(std::vector< uint8_t > data)
Definition: binary_plugin_router.cpp:8
BinaryPluginRouter::TryStart
virtual PluginResult TryStart() override
Definition: binary_plugin_router.cpp:42
skyway_plugin.h
getBinaryPluginRouterComponent
Component< fruit::Annotated< BinaryAnnotation, PluginRouterFactory > > getBinaryPluginRouterComponent()
Definition: binary_plugin_router.cpp:87
BinaryPluginRouter::plugin_loader_
pluginlib::ClassLoader< skyway_plugin::SkyWayBinaryPlugin > plugin_loader_
Definition: binary_plugin_router.h:23
BinaryPluginRouter
Definition: binary_plugin_router.h:20
BinaryPluginRouter::config
config
Definition: binary_plugin_router.h:35
BinaryPluginRouter::target_socket_
udp::endpoint target_socket_
Definition: binary_plugin_router.h:25
pluginlib::ClassLoader< skyway_plugin::SkyWayBinaryPlugin >
BinaryPluginRouter::socket_
std::unique_ptr< Socket > socket_
Definition: binary_plugin_router.h:26
SocketFactory
std::function< std::unique_ptr< Socket >(udp::endpoint, std::shared_ptr< std::function< void(std::vector< uint8_t >)> >)> SocketFactory
Definition: udp_socket.h:69
BinaryPluginRouter::nh_
ros::NodeHandle nh_
Definition: binary_plugin_router.h:22
PluginResult
Definition: plugin_router.h:14
plugin_router.h
ros::NodeHandle


skyway
Author(s): Toshiya Nakakura
autogenerated on Thu Oct 26 2023 02:42:21