aboutsummaryrefslogtreecommitdiff
path: root/zencore/include
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-09-09 13:58:37 +0200
committerStefan Boberg <[email protected]>2021-09-09 13:58:37 +0200
commit565f08ec3327c6cdad2eeb2fac1f45a1a24b95cf (patch)
treedfce4e0b8cbbafb416c9a7ce7e38a3d25fbdde48 /zencore/include
parentMoved http.sys server implementation into dedicated source files (diff)
downloadzen-565f08ec3327c6cdad2eeb2fac1f45a1a24b95cf.tar.xz
zen-565f08ec3327c6cdad2eeb2fac1f45a1a24b95cf.zip
Made HttpServer an abstract interface, and moved remaining implementation specifics for http.sys into the dedicated cpp/h source files
Diffstat (limited to 'zencore/include')
-rw-r--r--zencore/include/zencore/httpserver.h22
1 files changed, 7 insertions, 15 deletions
diff --git a/zencore/include/zencore/httpserver.h b/zencore/include/zencore/httpserver.h
index a0be54665..4a8cef262 100644
--- a/zencore/include/zencore/httpserver.h
+++ b/zencore/include/zencore/httpserver.h
@@ -300,25 +300,17 @@ private:
* Implements the main event loop to service HTTP requests, and handles routing
* requests to the appropriate endpoint handler as registered via AddEndpoint
*/
-class HttpServer
+class HttpServer : public RefCounted
{
public:
- HttpServer();
- ~HttpServer();
-
- void AddEndpoint(const char* endpoint, std::function<void(HttpServerRequest&)> handler);
- void AddEndpoint(HttpService& Service);
-
- void Initialize(int BasePort);
- void Run(bool TestMode);
- void RequestExit();
-
-private:
- struct Impl;
-
- RefPtr<Impl> m_Impl;
+ virtual void AddEndpoint(HttpService& Service) = 0;
+ virtual void Initialize(int BasePort) = 0;
+ virtual void Run(bool TestMode) = 0;
+ virtual void RequestExit() = 0;
};
+Ref<HttpServer> CreateHttpServer();
+
//////////////////////////////////////////////////////////////////////////
class HttpRouterRequest