| 68 | |
| 69 | template<typename Agent, typename ParamsType, typename ResultType, typename Handler> |
| 70 | bool invoke_binary_method( |
| 71 | Agent *agent, common::IInputStream &body_stream, Request &&binary_req, std::string &raw_response, Handler handler) { |
| 72 | ParamsType params{}; |
| 73 | ResultType result{}; |
| 74 | |
| 75 | seria::BinaryInputStream ba(body_stream); |
| 76 | ser(params, ba); |
| 77 | |
| 78 | common::JsonValue jid = binary_req.get_id().get(); |
| 79 | http::RequestBody empty_http_req; // Do not move into handler call, will not compile on MSVC 2017 |
| 80 | bool success = handler(agent, std::move(empty_http_req), std::move(binary_req), std::move(params), result); |
| 81 | |
| 82 | if (success) |
| 83 | raw_response = create_binary_response_body(result, jid); |
| 84 | return success; |
| 85 | } |
| 86 | |
| 87 | template<typename Owner, typename Agent, typename ParamsType, typename ResultType> |
| 88 | std::function<bool(Owner *, Agent *, common::IInputStream &, Request &&, std::string &)> make_binary_member_method( |
nothing calls this directly
no test coverage detected