5#ifndef MP_PROXY_TYPE_STRUCT_H
6#define MP_PROXY_TYPE_STRUCT_H
11template <
size_t index,
typename LocalType,
typename Value,
typename Output>
18 using Index = std::integral_constant<size_t, index>;
20 using Accessor =
typename std::tuple_element<index, typename ProxyStruct<Struct>::Accessors>::type;
21 auto&& field_output = Make<StructField, Accessor>(output);
24 BuildOne<index + 1>(param, invoke_context, output, value);
27template <
size_t index,
typename LocalType,
typename Value,
typename Output>
36template <
typename LocalType,
typename Value,
typename Output>
44 BuildOne<0>(local_type, invoke_context, output.init(), value);
47template <
size_t index,
typename LocalType,
typename Input,
typename Value>
54 using Index = std::integral_constant<size_t, index>;
56 using Accessor =
typename std::tuple_element<index, typename ProxyStruct<Struct>::Accessors>::type;
57 const auto& struc = input.get();
61 ReadOne<index + 1>(param, invoke_context, input, value);
64template <
size_t index,
typename LocalType,
typename Input,
typename Value>
73template <
typename LocalType,
typename Input,
typename ReadDest>
81 return read_dest.update([&](
auto& value) { ReadOne<0>(param, invoke_context, input, value); });
Functions to serialize / deserialize common bitcoin types.
void BuildField(TypeList< LocalTypes... >, Context &context, Output &&output, Values &&... values)
void BuildOne(TypeList< LocalType > param, InvokeContext &invoke_context, Output &&output, Value &&value, typename std::enable_if< index< ProxyType< LocalType >::fields >::type *enable=nullptr)
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...
decltype(auto) ReadField(TypeList< LocalTypes... >, Args &&... args)
std::decay_t< T > Decay
Type helper abbreviating std::decay.
std::remove_cv_t< std::remove_reference_t< T > > RemoveCvRef
Substitutue for std::remove_cvref_t.
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...
void ReadOne(TypeList< LocalType > param, InvokeContext &invoke_context, Input &&input, Value &&value, typename std::enable_if< index !=ProxyType< LocalType >::fields >::type *enable=nullptr)
Accessor type holding flags that determine how to access a message field.
Function parameter type for prioritizing overloaded function calls that would otherwise be ambiguous.
Mapping from local c++ type to capnp type and traits (specializations are generated by proxy-codegen....
Destination parameter type that can be passed to ReadField function as an alternative to ReadDestEmpl...
Generic utility functions used by capnp code.