23 lines
568 B
C++
23 lines
568 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <unordered_map>
|
|
#include <cstdint>
|
|
|
|
namespace dmf_engine {
|
|
|
|
class NodeControlClient {
|
|
public:
|
|
bool send_command(uint16_t port, const std::string& json_cmd);
|
|
std::string send_command_with_response(uint16_t port, const std::string& json_cmd);
|
|
|
|
void register_node(const std::string& node_id, uint16_t port);
|
|
void unregister_node(const std::string& node_id);
|
|
uint16_t get_port(const std::string& node_id) const;
|
|
|
|
private:
|
|
std::unordered_map<std::string, uint16_t> node_ports_;
|
|
};
|
|
|
|
} // namespace dmf_engine
|