5 #ifndef MP_PROXY_TYPE_INTERFACE_H 6 #define MP_PROXY_TYPE_INTERFACE_H 11 template <
typename Interface,
typename Impl>
14 return kj::heap<ProxyServer<Interface>>(std::move(impl), context.
connection);
17 template <
typename Interface,
typename Impl>
20 return MakeProxyServer<Interface, Impl>(context, std::move(impl));
23 template <
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())));
37 template <
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::forward<Value>(value)));
51 template <
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*){})));
66 template <
typename Interface,
typename Impl>
69 return std::make_unique<ProxyClient<Interface>>(
70 std::move(client), &context.
connection,
false);
73 template <
typename Interface,
typename Impl>
76 return MakeProxyClient<Interface, Impl>(context, kj::mv(client));
79 template <
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();
95 template <
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();
112 #endif // MP_PROXY_TYPE_INTERFACE_H std::unique_ptr< Impl > CustomMakeProxyClient(InvokeContext &context, typename Interface::Client &&client)
Function parameter type for prioritizing overloaded function calls that would otherwise be ambiguous...
bool CustomHasField(TypeList< LocalTypes... >, InvokeContext &invoke_context, const Input &input)
Return whether to read a C++ value from a Cap'n Proto field.
Generic utility functions used by capnp code.
kj::Own< typename Interface::Server > CustomMakeProxyServer(InvokeContext &context, std::shared_ptr< Impl > &&impl)
Functions to serialize / deserialize common bitcoin types.
std::unique_ptr< Impl > MakeProxyClient(InvokeContext &context, typename Interface::Client &&client)
decltype(auto) CustomReadField(TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest) requires Unserializable< LocalType
Overload multiprocess library's CustomReadField hook to allow any object with an Unserialize method t...
void CustomBuildField(TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output) requires Serializable< LocalType
Overload multiprocess library's CustomBuildField hook to allow any serializable object to be stored i...
std::decay_t< T > Decay
Type helper abbreviating std::decay.
kj::Own< typename Interface::Server > MakeProxyServer(InvokeContext &context, std::shared_ptr< Impl > impl)