ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
HttpServerRequestHandler.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 // ----------------------------------------------------------------------------
8 // Contains source code from
9 // https://github.com/mpromonet/webrtc-streamer
10 //
11 // This software is in the public domain, furnished "as is", without technical
12 // support, and with no warranty, express or implied, as to its usefulness for
13 // any purpose.
14 // ----------------------------------------------------------------------------
15 //
16 // This is a private header. It shall be hidden from CloudViewer's public API.
17 // Do not put this in CloudViewer.h.in.
18 
19 #pragma once
20 
21 #include <CivetServer.h>
22 #include <json/json.h>
23 
24 #include <functional>
25 #include <map>
26 
27 namespace cloudViewer {
28 namespace visualization {
29 namespace webrtc_server {
30 
31 class HttpServerRequestHandler : public CivetServer {
32 public:
33  typedef std::function<Json::Value(const struct mg_request_info* req_info,
34  const Json::Value&)>
36 
37  HttpServerRequestHandler(std::map<std::string, HttpFunction>& func,
38  const std::vector<std::string>& options);
39 };
40 
41 } // namespace webrtc_server
42 } // namespace visualization
43 } // namespace cloudViewer
cloudViewer
Generic file read and write utility for python interface.
Definition: CloudViewerConfig.cpp:12
cloudViewer::visualization::webrtc_server::LogMessage
static int LogMessage(const struct mg_connection *conn, const char *message)
Definition: HttpServerRequestHandler.cpp:26
cloudViewer::visualization::webrtc_server::RequestHandler::handle
bool handle(CivetServer *server, struct mg_connection *conn)
Definition: HttpServerRequestHandler.cpp:43
HttpServerRequestHandler.h
cloudViewer::visualization::webrtc_server::getCivetCallbacks
static const struct CivetCallbacks * getCivetCallbacks()
Definition: HttpServerRequestHandler.cpp:32
cloudViewer::visualization::webrtc_server::HttpServerRequestHandler::HttpFunction
std::function< Json::Value(const struct mg_request_info *req_info, const Json::Value &)> HttpFunction
Definition: HttpServerRequestHandler.h:35
cloudViewer::visualization::webrtc_server::RequestHandler::handleGet
bool handleGet(CivetServer *server, struct mg_connection *conn) override
Definition: HttpServerRequestHandler.cpp:75
cloudViewer::visualization::webrtc_server::RequestHandler::RequestHandler
RequestHandler(HttpServerRequestHandler::HttpFunction &func)
Definition: HttpServerRequestHandler.cpp:40
cloudViewer::visualization::webrtc_server::RequestHandler
Definition: HttpServerRequestHandler.cpp:38
LogDebug
#define LogDebug(...)
Definition: Logging.h:90
cloudViewer::visualization::webrtc_server::HttpServerRequestHandler
Definition: HttpServerRequestHandler.h:31
LogInfo
#define LogInfo(...)
Definition: Logging.h:81
cloudViewer::visualization::webrtc_server::_callbacks
static struct CivetCallbacks _callbacks
Definition: HttpServerRequestHandler.cpp:31
LogWarning
#define LogWarning(...)
Definition: Logging.h:72
Value
static vtkPVTrivialProducerStaticInternal Value
Definition: vtkDistributedTrivialProducer.cxx:65
cloudViewer::visualization::webrtc_server::RequestHandler::handlePost
bool handlePost(CivetServer *server, struct mg_connection *conn) override
Definition: HttpServerRequestHandler.cpp:78
cloudViewer::visualization::webrtc_server::HttpServerRequestHandler::HttpServerRequestHandler
HttpServerRequestHandler(std::map< std::string, HttpFunction > &func, const std::vector< std::string > &options)
Definition: HttpServerRequestHandler.cpp:126