Skip to content

Commit

Permalink
Experimental/pointers vec (#38)
Browse files Browse the repository at this point in the history
* Pointers are now working.
Need to dive into the benchmark functions to make sure they actually work though

* Restricting catch2 version

Catch2 v3 (catch3?) has breaking API changes and is a static library (vs. header only). Thus, the version must now be restricted to 2.X until v3.0 is officially supported.

* Fixed range parsing for Conan
  • Loading branch information
jharmer95 authored Oct 20, 2020
1 parent d4a2565 commit f64cb89
Show file tree
Hide file tree
Showing 13 changed files with 841 additions and 116 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ compiler:
addons:
apt:
packages:
- gcc
- g++
- cmake-data
- cmake
- ninja-build
Expand Down
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1...3.15)

project(
"rpc.hpp"
VERSION 0.2.0
VERSION 0.2.1
DESCRIPTION "Simple RPC Header-Only Library"
LANGUAGES CXX)

Expand Down Expand Up @@ -108,7 +108,8 @@ elseif(CXX_CLANG)
-Wno-missing-prototypes
-Wno-documentation
-Wno-documentation-unknown-command
-Wno-weak-vtables)
-Wno-weak-vtables
-Wno-reserved-id-macro)
set(MIN_WARNING -Wall)
endif()

Expand Down
6 changes: 3 additions & 3 deletions dispatch_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@
f.write("_FE2_0)(ACTION, __VA_ARGS__))\n\n")

f.write(
"#define RPC_ATTACH_FUNC(FUNCNAME) if (func_name == #FUNCNAME) { auto pack = create_func(FUNCNAME, serial_obj); run_callback(FUNCNAME, pack); serial_obj = serial_adapter<Serial>::from_packed_func(pack); return; }\n"
"#define RPC_ATTACH_FUNC(FUNCNAME) if (func_name == #FUNCNAME) { return dispatch_func<Serial>(FUNCNAME, serial_obj); }\n"
)
f.write(
"#define RPC_ATTACH_FUNCS(FUNCNAME, ...) EXPAND(RPC_FOR_EACH(RPC_ATTACH_FUNC, FUNCNAME, __VA_ARGS__))\n\n"
)
f.write(
"#define RPC_ALIAS_FUNC(FUNCNAME, FUNC_ALIAS) if (func_name == #FUNC_ALIAS) { auto pack = create_func(FUNCNAME, serial_obj); run_callback(FUNCNAME, pack); serial_obj = serial_adapter<Serial>::from_packed_func(pack); return; }\n"
"#define RPC_ALIAS_FUNC(FUNCNAME, FUNC_ALIAS) if (func_name == #FUNC_ALIAS) { return dispatch_func<Serial>(FUNCNAME, serial_obj); }\n"
)
f.write(
"#define RPC_MULTI_ALIAS_FUNC(FUNCNAME, FUNC_ALIAS,...) EXPAND(RPC_FOR_EACH2(RPC_ALIAS_FUNC, FUNCNAME, FUNC_ALIAS, __VA_ARGS__))\n\n"
)
f.write(
'#define RPC_DEFAULT_DISPATCH(FUNCNAME, ...) EXPAND(template<typename Serial> void rpc::server::dispatch(Serial& serial_obj) { const auto func_name = serial_adapter<Serial>::extract_func_name(serial_obj); RPC_ATTACH_FUNCS(FUNCNAME, __VA_ARGS__); throw std::runtime_error("RPC error: Called function: \"" + func_name + "\" not found!");})\n'
'#define RPC_DEFAULT_DISPATCH(FUNCNAME, ...) EXPAND(template<typename Serial> void rpc::server::dispatch(Serial& serial_obj) { const auto func_name = serial_adapter<Serial>::extract_func_name(serial_obj); RPC_ATTACH_FUNCS(FUNCNAME, __VA_ARGS__) throw std::runtime_error("RPC error: Called function: \"" + func_name + "\" not found!");})\n'
)
Loading

0 comments on commit f64cb89

Please sign in to comment.