plugin_router_factory.cpp
Go to the documentation of this file.
1 //
2 // Created by nakakura on 22/09/02.
3 //
4 
6 
7 std::unique_ptr<PluginRouter> PluginRouterFactoryImpl::Create(
8  std::string target_ip, uint16_t port, std::string plugin_type,
9  std::shared_ptr<rapidjson::Document> config) {
10  if (plugin_type == "binary") {
11  return binary_factory_(
12  config, udp::endpoint(address::from_string(target_ip), port));
13  } else if (plugin_type == "json") {
14  return json_factory_(config,
15  udp::endpoint(address::from_string(target_ip), port));
16  } else {
17  return string_factory_(
18  config, udp::endpoint(address::from_string(target_ip), port));
19  }
20 }
21 
22 Component<IPluginRouterFactory> getPluginFactoryComponent() {
23  return createComponent()
28 }
Component< fruit::Annotated< StringAnnotation, PluginRouterFactory > > getStringPluginRouterComponent()
virtual std::unique_ptr< PluginRouter > Create(std::string target_ip, uint16_t target_port, std::string plugin_type, std::shared_ptr< rapidjson::Document > config) override
Component< IPluginRouterFactory > getPluginFactoryComponent()
PluginRouterFactory binary_factory_
Component< fruit::Annotated< JsonAnnotation, PluginRouterFactory > > getJsonPluginRouterComponent()
Component< fruit::Annotated< BinaryAnnotation, PluginRouterFactory > > getBinaryPluginRouterComponent()
PluginRouterFactory json_factory_
PluginRouterFactory string_factory_


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