5#ifndef MP_PROXY_TYPE_POINTER_H
6#define MP_PROXY_TYPE_POINTER_H
11template <
typename LocalType,
typename Value,
typename Output>
19template <
typename LocalType,
typename Value,
typename Output>
31template <
typename LocalType,
typename Input,
typename ReadDest>
38 return read_dest.update([&](
auto& value) {
45template <
typename LocalType,
typename Input,
typename ReadDest>
52 return read_dest.update([&](
auto& value) {
60 value = std::make_shared<LocalType>(std::forward<
decltype(
args)>(
args)...);
67template <
typename LocalType,
typename Input,
typename ReadDest>
74 return read_dest.update([&](
auto& value) {
81 value = std::make_shared<LocalType>(std::forward<
decltype(
args)>(
args)...);
88template <
typename Accessor,
typename LocalType,
typename ServerContext,
typename Fn,
typename... Args>
91 const auto& params = server_context.
call_context.getParams();
92 const auto& input = Make<StructField, Accessor>(params);
95 fn.invoke(server_context, std::forward<Args>(
args)...,
nullptr);
105 fn.invoke(server_context, std::forward<Args>(
args)..., ¶m);
107 auto&& results = server_context.
call_context.getResults();
109 Make<StructField, Accessor>(results), param);
Functions to serialize / deserialize common bitcoin types.
void MaybeBuildField(std::true_type, Args &&... args)
bool CustomHasField(TypeList< LocalTypes... >, InvokeContext &invoke_context, const Input &input)
Return whether to read a C++ value from a Cap'n Proto field.
void MaybeReadField(std::true_type, Args &&... args)
void BuildField(TypeList< LocalTypes... >, Context &context, Output &&output, Values &&... values)
auto PassField(Priority< 1 >, TypeList< LocalType & >, ServerContext &server_context, Fn &&fn, Args &&... args) -> Require< typename decltype(Accessor::get(server_context.call_context.getParams()))::Calls >
PassField override for callable interface reference arguments.
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...
ServerInvokeContext< ProxyServer< Interface >, ::capnp::CallContext< Params, Results > > ServerContext
std::decay_t< T > Decay
Type helper abbreviating std::decay.
decltype(auto) ReadField(TypeList< LocalTypes... >, InvokeContext &invoke_context, Input &&input, Args &&... args)
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...
Specialization of above (base case)
Function parameter type for prioritizing overloaded function calls that would otherwise be ambiguous.
Destination parameter type that can be passed to ReadField function as an alternative to ReadDestEmpl...
CallContext & call_context
Generic utility functions used by capnp code.