5#ifndef MP_PROXY_TYPE_FUNCTION_H
6#define MP_PROXY_TYPE_FUNCTION_H
12template <
typename Result,
typename... Args>
15 using Fn = std::function<Result(Args...)>;
23template <
typename Value,
typename FnR,
typename... FnParams,
typename Output>
31 using Interface =
typename decltype(output.get())::Calls;
34 std::make_shared<Callback>(std::forward<Value>(value)), invoke_context.
connection));
41template <
typename InvokeContext>
46 template <
typename... CallParams>
47 decltype(
auto)
operator()(CallParams&&... params) {
return this->m_proxy->call(std::forward<CallParams>(params)...); }
50template <
typename FnR,
typename... FnParams,
typename Input,
typename ReadDest>
58 using Interface =
typename Decay<
decltype(input.get())>::Calls;
59 auto client = std::make_shared<ProxyClient<Interface>>(
60 input.get(), &invoke_context.
connection,
false);
61 return read_dest.construct(
ProxyCallFn<
decltype(client)>{std::move(client)});
63 return read_dest.construct();
Wrapper around std::function for passing std::function objects between client and servers.
Adapter to convert ProxyCallback object call to function object call.
Result call(Args &&... args) override
std::function< Result(Args...)> Fn
Functions to serialize / deserialize common bitcoin types.
bool CustomHasField(TypeList< LocalTypes... >, InvokeContext &invoke_context, const Input &input)
std::decay_t< T > Decay
Type helper abbreviating std::decay.
decltype(auto) CustomReadField(TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
void CustomBuildField(TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output)
Generic utility functions used by capnp code.