added external rpc implementation

This commit is contained in:
Artur Mukhamadiev 2026-02-06 17:37:07 +03:00
parent 9b482ae956
commit 4ddaea91a7
4 changed files with 13 additions and 8 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "rpc"]
path = rpc
url = https://github.com/jsonrpcx/json-rpc-cxx.git

View File

@ -1,20 +1,21 @@
#pragma once
#include <string>
#include <functional>
#include <jsonrpccxx/server.hpp>
#include <map>
#include <nlohmann/json.hpp>
#include <string>
namespace cloud_point_rpc {
class RpcServer {
public:
public:
using Handler = std::function<nlohmann::json(const nlohmann::json&)>;
void register_method(const std::string& name, Handler handler);
[[nodiscard]] std::string process(const std::string& request_str);
private:
private:
std::map<std::string, Handler> handlers_;
};

View File

@ -22,7 +22,7 @@ gtest_dep = gtest_proj.get_variable('gtest_dep')
gtest_main_dep = gtest_proj.get_variable('gtest_main_dep')
gmock_dep = gtest_proj.get_variable('gmock_dep')
inc = include_directories('include')
inc = include_directories(['include', 'rpc/include'])
subdir('src')
subdir('tests')

1
rpc Submodule

@ -0,0 +1 @@
Subproject commit a0e195b575d62cb07016321ac9cd7e1b9e048fe5