diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..c1bddb0 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "rpc"] + path = rpc + url = https://github.com/jsonrpcx/json-rpc-cxx.git diff --git a/include/cloud_point_rpc/rpc_server.hpp b/include/cloud_point_rpc/rpc_server.hpp index 88b9d5f..285da62 100644 --- a/include/cloud_point_rpc/rpc_server.hpp +++ b/include/cloud_point_rpc/rpc_server.hpp @@ -1,21 +1,22 @@ #pragma once -#include #include +#include #include #include +#include namespace cloud_point_rpc { class RpcServer { - public: - using Handler = std::function; +public: + using Handler = std::function; - void register_method(const std::string& name, Handler handler); - [[nodiscard]] std::string process(const std::string& request_str); + void register_method(const std::string& name, Handler handler); + [[nodiscard]] std::string process(const std::string& request_str); - private: - std::map handlers_; +private: + std::map handlers_; }; } // namespace cloud_point_rpc diff --git a/meson.build b/meson.build index 0c3802a..5b8060a 100644 --- a/meson.build +++ b/meson.build @@ -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') diff --git a/rpc b/rpc new file mode 160000 index 0000000..a0e195b --- /dev/null +++ b/rpc @@ -0,0 +1 @@ +Subproject commit a0e195b575d62cb07016321ac9cd7e1b9e048fe5