Bitcoin Core
32.1.0
P2P Digital Currency
Toggle main menu visibility
Loading...
Searching...
No Matches
src
ipc
libmultiprocess
include
mp
type-unordered-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_UNORDERED_SET_H
6
#define MP_PROXY_TYPE_UNORDERED_SET_H
7
8
#include <
mp/proxy-types.h
>
9
#include <
mp/util.h
>
10
#include <unordered_set>
11
12
namespace
mp
{
13
template
<
typename
LocalType,
typename
Value,
typename
Output>
14
void
CustomBuildField
(
TypeList
<std::unordered_set<LocalType>>,
15
Priority<1>
,
16
InvokeContext
& invoke_context,
17
Value&& value,
18
Output&& output)
19
{
20
BuildList
(
TypeList<LocalType>
(), invoke_context, output, value);
21
}
22
23
template
<
typename
LocalType,
typename
Input,
typename
ReadDest>
24
decltype
(
auto
)
CustomReadField
(
TypeList
<std::unordered_set<LocalType>>,
25
Priority<1>
,
26
InvokeContext
& invoke_context,
27
Input&& input,
28
ReadDest&& read_dest)
29
{
30
return
ReadList
(
31
TypeList<LocalType>
(), invoke_context, input, read_dest,
32
[&](
auto
& value,
size_t
size) {
33
value.clear();
34
value.reserve(size);
35
},
36
[&](
auto
& value,
auto
&&...
args
) ->
auto
& {
37
return
*value.emplace(std::forward<
decltype
(
args
)>(
args
)...).first;
38
});
39
}
40
}
// namespace mp
41
42
#endif
// MP_PROXY_TYPE_UNORDERED_SET_H
args
ArgsManager & args
Definition
bitcoind.cpp:280
util.h
mp
Functions to serialize / deserialize common bitcoin types.
Definition
common-types.h:58
mp::BuildList
void BuildList(TypeList< LocalType >, InvokeContext &invoke_context, Output &&output, Value &&value)
Definition
proxy-types.h:284
mp::CustomReadField
decltype(auto) CustomReadField(TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
Definition
common-types.h:84
mp::ReadList
decltype(auto) ReadList(TypeList< LocalType >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest, InitFn &&init, EmplaceFn &&emplace)
Definition
proxy-types.h:295
mp::CustomBuildField
void CustomBuildField(TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output)
Definition
common-types.h:64
proxy-types.h
mp::InvokeContext
Definition
proxy-io.h:33
mp::Priority
Definition
util.h:115
mp::TypeList
Generic utility functions used by capnp code.
Definition
util.h:39
Generated on
for Bitcoin Core by
1.18.0