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_PLUGINROUTER_H
6 #define SKYWAY_PLUGIN_UDP_PIPE_PLUGINROUTER_H
7 
8 #include <rapidjson/document.h>
9 #include <rapidjson/stringbuffer.h>
10 #include <rapidjson/writer.h>
11 
12 using namespace rapidjson;
13 
14 struct PluginResult {
15  bool is_success;
16  uint16_t port;
17  const char* error_message;
18 };
19 
20 class PluginRouter {
21  private:
22  public:
23  virtual ~PluginRouter() = default;
24  virtual PluginResult TryStart() { return {true, 0, ""}; }
25  virtual uint16_t Port() = 0;
26 };
27 
28 using PluginRouterFactory = std::function<std::unique_ptr<PluginRouter>(
29  std::shared_ptr<rapidjson::Document>, udp::endpoint)>;
30 
31 #endif // SKYWAY_PLUGIN_UDP_PIPE_PLUGINROUTER_H
PluginRouter
Definition: plugin_router.h:20
PluginRouter::TryStart
virtual PluginResult TryStart()
Definition: plugin_router.h:24
PluginResult::error_message
const char * error_message
Definition: plugin_router.h:17
PluginResult::port
uint16_t port
Definition: plugin_router.h:16
PluginRouterFactory
std::function< std::unique_ptr< PluginRouter >(std::shared_ptr< rapidjson::Document >, udp::endpoint)> PluginRouterFactory
Definition: plugin_router.h:29
PluginResult::is_success
bool is_success
Definition: plugin_router.h:15
PluginResult
Definition: plugin_router.h:14


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