5#ifndef MP_PROXY_TYPE_DATA_H
6#define MP_PROXY_TYPE_DATA_H
11template <
typename T,
typename U>
13 std::convertible_to<T, std::span<const U>> &&
14 std::constructible_from<T, const U*, const U*>;
27template <
typename LocalType,
typename Value,
typename Output>
31 auto data = std::span{value};
32 auto result = output.init(
data.size());
33 memcpy(result.begin(),
data.data(),
data.size());
36template <
typename LocalType,
typename Input,
typename ReadDest>
40 using ByteType =
decltype(std::span{std::declval<LocalType>().begin(), std::declval<LocalType>().end()})::element_type;
41 const kj::byte *begin{input.get().begin()}, *end{input.get().end()};
42 return read_dest.construct(
reinterpret_cast<const ByteType*
>(begin),
reinterpret_cast<const ByteType*
>(end));
Functions to serialize / deserialize common bitcoin types.
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...
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.