5#ifndef MP_PROXY_TYPE_INTERFACE_H
6#define MP_PROXY_TYPE_INTERFACE_H
11template <
typename Interface,
typename Impl>
14 return kj::heap<ProxyServer<Interface>>(std::move(impl), context.
connection);
17template <
typename Interface,
typename Impl>
20 return MakeProxyServer<Interface, Impl>(context, std::move(impl));
23template <
typename Impl,
typename Value,
typename Output>
29 typename Decay<
decltype(output.get())>::Calls* enable =
nullptr)
32 using Interface =
typename decltype(output.get())::Calls;
33 output.set(CustomMakeProxyServer<Interface, Impl>(invoke_context, std::shared_ptr<Impl>(value.release())));
37template <
typename Impl,
typename Value,
typename Output>
43 typename Decay<
decltype(output.get())>::Calls* enable =
nullptr)
46 using Interface =
typename decltype(output.get())::Calls;
47 output.set(CustomMakeProxyServer<Interface, Impl>(invoke_context, std::move(value)));
51template <
typename Impl,
typename Output>
57 typename decltype(output.get())::Calls* enable =
nullptr)
62 using Interface =
typename decltype(output.get())::Calls;
63 output.set(CustomMakeProxyServer<Interface, Impl>(invoke_context, std::shared_ptr<Impl>(&value, [](Impl*){})));
66template <
typename Interface,
typename Impl>
69 return std::make_unique<ProxyClient<Interface>>(
70 std::move(client), &context.
connection,
false);
73template <
typename Interface,
typename Impl>
76 return MakeProxyClient<Interface, Impl>(context, kj::mv(client));
79template <
typename LocalType,
typename Input,
typename ReadDest>
85 typename Decay<
decltype(input.get())>::Calls* enable =
nullptr)
87 using Interface =
typename Decay<
decltype(input.get())>::Calls;
89 return read_dest.construct(
90 CustomMakeProxyClient<Interface, LocalType>(invoke_context, std::move(input.get())));
92 return read_dest.construct();
95template <
typename LocalType,
typename Input,
typename ReadDest>
100 ReadDest&& read_dest,
101 typename Decay<
decltype(input.get())>::Calls* enable =
nullptr)
103 using Interface =
typename Decay<
decltype(input.get())>::Calls;
105 return read_dest.construct(
106 CustomMakeProxyClient<Interface, LocalType>(invoke_context, std::move(input.get())));
108 return read_dest.construct();
Functions to serialize / deserialize common bitcoin types.
std::unique_ptr< Impl > CustomMakeProxyClient(InvokeContext &context, typename Interface::Client &&client)
kj::Own< typename Interface::Server > MakeProxyServer(InvokeContext &context, std::shared_ptr< Impl > impl)
decltype(auto) CustomReadField(TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
Overload multiprocess library's CustomReadField hook to allow any object with an Unserialize method t...
std::decay_t< T > Decay
Type helper abbreviating std::decay.
kj::Own< typename Interface::Server > CustomMakeProxyServer(InvokeContext &context, std::shared_ptr< Impl > &&impl)
std::unique_ptr< Impl > MakeProxyClient(InvokeContext &context, typename Interface::Client &&client)
void CustomBuildField(TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output)
Overload multiprocess library's CustomBuildField hook to allow any serializable object to be stored i...
Function parameter type for prioritizing overloaded function calls that would otherwise be ambiguous.
Generic utility functions used by capnp code.