string_plugin_router.h
Go to the documentation of this file.
1 //
2 // Created by nakakura on 22/08/31.
3 //
4 
5 #ifndef SKYWAY_PLUGIN_UDP_PIPE_STRING_PLUGIN_ROUTER_H
6 #define SKYWAY_PLUGIN_UDP_PIPE_STRING_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:
23  std::vector<boost::shared_ptr<skyway_plugin::SkyWayStringPlugin>> plugins_;
24  udp::endpoint target_socket_;
25  std::unique_ptr<Socket> socket_;
26  std::shared_ptr<rapidjson::Document> config_;
27 
28  void observe_socket(std::vector<uint8_t> data);
29  void observe_plugins(std::string message);
30 
31  public:
32  StringPluginRouter() = delete;
33  INJECT(StringPluginRouter(ASSISTED(std::shared_ptr<rapidjson::Document>)
35  ASSISTED(udp::endpoint) target_socket,
38 
39  virtual PluginResult TryStart() override;
40  virtual uint16_t Port() override;
41 };
42 
43 struct StringAnnotation {};
44 
45 Component<fruit::Annotated<StringAnnotation, PluginRouterFactory>>
47 
48 #endif // SKYWAY_PLUGIN_UDP_PIPE_STRING_PLUGIN_ROUTER_H
StringPluginRouter::TryStart
virtual PluginResult TryStart() override
Definition: string_plugin_router.cpp:46
StringPluginRouter::plugin_loader_
pluginlib::ClassLoader< skyway_plugin::SkyWayStringPlugin > plugin_loader_
Definition: string_plugin_router.h:22
StringPluginRouter::observe_plugins
void observe_plugins(std::string message)
Definition: string_plugin_router.cpp:16
class_loader.h
StringPluginRouter::config_
std::shared_ptr< rapidjson::Document > config_
Definition: string_plugin_router.h:26
ros.h
PluginRouter
Definition: plugin_router.h:20
StringPluginRouter::factory
SocketFactory factory
Definition: string_plugin_router.h:36
StringPluginRouter::Port
virtual uint16_t Port() override
Definition: string_plugin_router.cpp:86
getStringPluginRouterComponent
Component< fruit::Annotated< StringAnnotation, PluginRouterFactory > > getStringPluginRouterComponent()
Definition: string_plugin_router.cpp:89
StringAnnotation
Definition: string_plugin_router.h:43
skyway_plugin.h
StringPluginRouter::StringPluginRouter
StringPluginRouter()=delete
Definition: string_plugin_router.cpp:22
StringPluginRouter::ASSISTED
ASSISTED(udp::endpoint) target_socket
pluginlib::ClassLoader< skyway_plugin::SkyWayStringPlugin >
StringPluginRouter::observe_socket
void observe_socket(std::vector< uint8_t > data)
Definition: string_plugin_router.cpp:8
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
StringPluginRouter::target_socket_
udp::endpoint target_socket_
Definition: string_plugin_router.h:24
StringPluginRouter::plugins_
std::vector< boost::shared_ptr< skyway_plugin::SkyWayStringPlugin > > plugins_
Definition: string_plugin_router.h:23
StringPluginRouter::socket_
std::unique_ptr< Socket > socket_
Definition: string_plugin_router.h:25
PluginResult
Definition: plugin_router.h:14
StringPluginRouter
Definition: string_plugin_router.h:20
StringPluginRouter::~StringPluginRouter
~StringPluginRouter()
Definition: string_plugin_router.cpp:35
StringPluginRouter::config
config
Definition: string_plugin_router.h:34
plugin_router.h


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