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
const char * error_message
Definition: plugin_router.h:17
virtual PluginResult TryStart()
Definition: plugin_router.h:24
uint16_t port
Definition: plugin_router.h:16
std::function< std::unique_ptr< PluginRouter >(std::shared_ptr< rapidjson::Document >, udp::endpoint)> PluginRouterFactory
Definition: plugin_router.h:29


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