From 3396ea3e7cf5a0def0ea720bcb863b374fd1cd0e Mon Sep 17 00:00:00 2001 From: Nikita Kostovsky Date: Thu, 13 Nov 2025 12:12:07 +0100 Subject: implement GET_pixels in http server --- src/httpservice.h | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'src/httpservice.h') diff --git a/src/httpservice.h b/src/httpservice.h index 2b0e7f5..0fbd54d 100644 --- a/src/httpservice.h +++ b/src/httpservice.h @@ -2,22 +2,41 @@ // qt #include +#include +// #include class ICamera; +class QHttpServer; -class HttpServer +class HttpServer // : public QObject { + // Q_OBJECT + +private: + struct Stats + { + uint64_t GET_pixels_us{0}; + } m_stats{0}; + public: static constexpr auto DefaultAddress = QHostAddress::Any; - static constexpr uint16_t DefaultPort{8081}; + static constexpr uint16_t DefaultPort{8080}; public: - explicit HttpServer(const std::shared_ptr &camera, + explicit HttpServer(ICamera *camera, + // QObject *parent = nullptr, const QHostAddress &address = DefaultAddress, const uint16_t port = DefaultPort); + // TODO: methods starting with GET_/POST_ will be routed automatically +public: + QHttpServerResponse GET_pixels(); + private: - std::shared_ptr m_camera{nullptr}; + // std::weak_ptr m_camera; + ICamera *m_camera{nullptr}; QHostAddress m_address{DefaultAddress}; uint16_t m_port{DefaultPort}; + + std::shared_ptr m_server; }; -- cgit v1.2.3-70-g09d2