17 #ifndef COM_BORA_SOFTWARE__BALAU_NETWORK_HTTP_SERVER_WS_WEB_APPS__ROUTING_WS_WEB_APP 18 #define COM_BORA_SOFTWARE__BALAU_NETWORK_HTTP_SERVER_WS_WEB_APPS__ROUTING_WS_WEB_APP 58 public:
using Value = std::tuple<std::string, WsWebAppPtr, WsWebAppPtr, WsWebAppPtr>;
91 private:
static constexpr
size_t KeyIndex = 0;
92 private:
static constexpr
size_t ControlHandlerIndex = 1;
93 private:
static constexpr
size_t TextHandlerIndex = 2;
104 template <
typename HandlerT,
typename ... ParamT>
106 auto handler = std::shared_ptr<WsWebApp>(
new HandlerT(std::move(param) ...));
116 template <
typename HandlerT>
118 auto handler = std::shared_ptr<WsWebApp>(
new HandlerT);
126 auto handler = std::shared_ptr<WsWebApp>(
nullptr);
132 #endif // COM_BORA_SOFTWARE__BALAU_NETWORK_HTTP_SERVER_WS_WEB_APPS__ROUTING_WS_WEB_APP Abstract base class of WebSocket web application handlers.
Abstract base class of WebSocket web application handlers.
Definition: WsWebApp.hpp:36
std::shared_ptr< WsWebApp > WsWebAppPtr
Shared pointer container for WebSocket web app instances.
Definition: RoutingWsWebApp.hpp:53
void handleTextMessage(WsSession &session, std::string_view path) override
Handle received text data.
std::tuple< std::string, WsWebAppPtr, WsWebAppPtr, WsWebAppPtr > Value
The type of the routing node values added to the routing trie.
Definition: RoutingWsWebApp.hpp:58
RoutingWsWebApp(Routing &&routing_)
Construct a routing HTTP handler, by supplying a preformed routing trie.
void handleBinaryMessage(WsSession &session, std::string_view path) override
Handle received binary data.
void handlePing(WsSession &session, std::string_view path) override
Handle a received ping control message.
void handlePong(WsSession &session, std::string_view path) override
Handle a received pong control message.
void handleClose(WsSession &session, std::string_view path) override
Handle a received close control message.
A WebSocket web application handler that routes to other handlers.
Definition: RoutingWsWebApp.hpp:49
An object based trie used for parent-child hierarchies.
Manages the handling of WebSocket messages in a WebSocket connection.
Definition: WsSession.hpp:35
RoutingWsWebApp::Value routingNode(const std::string &key, ParamT &&... param)
Convenience function to make a routing node from a handler type, a string key, and the handler constr...
Definition: RoutingWsWebApp.hpp:105
A set of WebSocket web apps provided by the Balau library.
Definition: EchoingWsWebApp.hpp:22