MCPcopy Create free account
hub / github.com/bcndev/bytecoin / invoke_binary_method

Function invoke_binary_method

src/http/BinaryRpc.hpp:70–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68
69template<typename Agent, typename ParamsType, typename ResultType, typename Handler>
70bool 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
87template<typename Owner, typename Agent, typename ParamsType, typename ResultType>
88std::function<bool(Owner *, Agent *, common::IInputStream &, Request &&, std::string &)> make_binary_member_method(

Callers

nothing calls this directly

Calls 3

serFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected