Bitcoin Core 32.99.0
P2P Digital Currency
Loading...
Searching...
No Matches
type-set.h
Go to the documentation of this file.
1// Copyright (c) The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#ifndef MP_PROXY_TYPE_SET_H
6#define MP_PROXY_TYPE_SET_H
7
8#include <mp/proxy-types.h>
9#include <mp/util.h>
10
11namespace mp {
12template <typename LocalType, typename Value, typename Output>
13void CustomBuildField(TypeList<std::set<LocalType>>,
16 Value&& value,
17 Output&& output)
18{
20}
21
22template <typename LocalType, typename Input, typename ReadDest>
23decltype(auto) CustomReadField(TypeList<std::set<LocalType>>,
26 Input&& input,
28{
29 return ReadList(
31 [&](auto& value, size_t) { value.clear(); },
32 [&](auto& value, auto&&... args) -> auto& {
33 return *value.emplace(std::forward<decltype(args)>(args)...).first;
34 });
35}
36} // namespace mp
37
38#endif // MP_PROXY_TYPE_SET_H
ArgsManager & args
Definition bitcoind.cpp:280
Functions to serialize / deserialize common bitcoin types.
void BuildList(TypeList< LocalType >, InvokeContext &invoke_context, Output &&output, Value &&value)
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) ReadList(TypeList< LocalType >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest, InitFn &&init, EmplaceFn &&emplace)
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.
Definition util.h:115
Generic utility functions used by capnp code.
Definition util.h:39
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
Definition time.h:82