5 #ifndef MP_PROXY_TYPE_DATA_H 6 #define MP_PROXY_TYPE_DATA_H 14 template <
typename T,
typename U>
16 std::convertible_to<T, std::span<const U>> &&
17 std::constructible_from<T, const U*, const U*>;
21 IsSpanOf<T, std::byte> ||
23 IsSpanOf<T, unsigned char> ||
24 IsSpanOf<T, signed char>;
30 template <
typename LocalType,
typename Value,
typename Output>
32 requires (std::is_same_v<decltype(output.get()), ::capnp::Data::Builder> && IsByteSpan<LocalType>)
34 auto data = std::span{value};
39 template <
typename LocalType,
typename Input,
typename ReadDest>
41 requires (
std::is_same_v<decltype(input.get()), ::capnp::Data::Reader> &&
IsByteSpan<LocalType>)
43 using ByteType = decltype(std::span{std::declval<LocalType>().begin(), std::declval<LocalType>().end()})::element_type;
44 const kj::byte *begin{input.get().begin()}, *end{input.get().end()};
45 return read_dest.construct(reinterpret_cast<const ByteType*>(begin), reinterpret_cast<const ByteType*>(end));
49 #endif // MP_PROXY_TYPE_DATA_H Function parameter type for prioritizing overloaded function calls that would otherwise be ambiguous...
memcpy(result.begin(), stream.data(), stream.size())
Generic utility functions used by capnp code.
Functions to serialize / deserialize common bitcoin types.
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...