Files
DMF-Studio/libs/dmf-node/include/dmf-node/control_server.hpp
T
Johanness 5b5ffa1308 feat: scaffold project framework with engine, node skeleton, and passthrough node
- CMake build system with vcpkg dependency management
- libdmf-node: Node interface, port definitions, WebSocket control
  server, node runner with MXL lifecycle management
- libdmf-engine: Graph model (nodes/edges CRUD, serialization),
  FlowManager (UUID + V210 NMOS flow definitions), ProcessManager
  (fork/exec node processes), ApiServer (REST API for graph control)
- Passthrough node: reads V210 grains from MXL, copies, writes to MXL
- Unit tests for Graph and FlowManager (6 cases, 21 assertions)
- MXL SDK as git submodule (symlinked from extern/mxl)
2026-05-26 01:32:50 +03:00

36 lines
781 B
C++

#pragma once
#include <dmf-node/node.hpp>
#include <functional>
#include <string>
#include <unordered_map>
#include <vector>
struct lws;
namespace dmf_node {
using CommandHandler = std::function<void(const nlohmann::json& payload)>;
using StatusCallback = std::function<void(const nlohmann::json& event)>;
class ControlServer {
public:
ControlServer(uint16_t port, StatusCallback on_event);
~ControlServer();
ControlServer(const ControlServer&) = delete;
ControlServer& operator=(const ControlServer&) = delete;
void register_command(const std::string& cmd, CommandHandler handler);
void send_event(const nlohmann::json& event);
void poll(int timeout_ms);
private:
struct Impl;
std::unique_ptr<Impl> impl_;
};
} // namespace dmf_node