#pragma once #include #include #include #include struct lws_context; namespace dmf_engine { using RequestHandler = std::function; class ApiServer { public: ApiServer(uint16_t port, Graph& graph, class FlowManager& flow_manager, class ProcessManager& process_manager, class NodeControlClient& control_client, const std::string& mxl_domain = "/dev/shm/mxl"); ~ApiServer(); ApiServer(const ApiServer&) = delete; ApiServer& operator=(const ApiServer&) = delete; void poll(int timeout_ms); private: void handle_rest(const std::string& method, const std::string& path, const std::string& body, std::string& response_status, std::string& response_content_type, std::string& response_body); struct Impl; std::unique_ptr impl_; }; } // namespace dmf_engine