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 }
PluginRouterFactoryImpl::binary_factory_
PluginRouterFactory binary_factory_
Definition: plugin_router_factory.h:30
getJsonPluginRouterComponent
Component< fruit::Annotated< JsonAnnotation, PluginRouterFactory > > getJsonPluginRouterComponent()
Definition: json_plugin_router.cpp:105
getStringPluginRouterComponent
Component< fruit::Annotated< StringAnnotation, PluginRouterFactory > > getStringPluginRouterComponent()
Definition: string_plugin_router.cpp:89
PluginRouterFactoryImpl
Definition: plugin_router_factory.h:28
PluginRouterFactoryImpl::json_factory_
PluginRouterFactory json_factory_
Definition: plugin_router_factory.h:31
IPluginRouterFactory
Definition: plugin_router_factory.h:19
plugin_router_factory.h
getBinaryPluginRouterComponent
Component< fruit::Annotated< BinaryAnnotation, PluginRouterFactory > > getBinaryPluginRouterComponent()
Definition: binary_plugin_router.cpp:87
getPluginFactoryComponent
Component< IPluginRouterFactory > getPluginFactoryComponent()
Definition: plugin_router_factory.cpp:22
PluginRouterFactoryImpl::string_factory_
PluginRouterFactory string_factory_
Definition: plugin_router_factory.h:32
PluginRouterFactoryImpl::Create
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
Definition: plugin_router_factory.cpp:7


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