Bitcoin Core
32.1.0
P2P Digital Currency
Toggle main menu visibility
Loading...
Searching...
No Matches
src
ipc
libmultiprocess
include
mp
type-vector.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_VECTOR_H
6
#define MP_PROXY_TYPE_VECTOR_H
7
8
#include <
mp/proxy-types.h
>
9
#include <
mp/util.h
>
10
11
namespace
mp
{
12
template
<
typename
LocalType,
typename
Value,
typename
Output>
13
void
CustomBuildField
(
TypeList
<std::vector<LocalType>>,
14
Priority<1>
,
15
InvokeContext
& invoke_context,
16
Value&& value,
17
Output&& output)
18
{
19
BuildList
(
TypeList<LocalType>
(), invoke_context, output, value);
20
}
21
22
inline
static
bool
BuildPrimitive
(
InvokeContext
& invoke_context, std::vector<bool>::const_reference value,
TypeList<bool>
)
23
{
24
return
value;
25
}
26
27
template
<
typename
LocalType,
typename
Input,
typename
ReadDest>
28
decltype
(
auto
)
CustomReadField
(
TypeList
<std::vector<LocalType>>,
29
Priority<1>
,
30
InvokeContext
& invoke_context,
31
Input&& input,
32
ReadDest&& read_dest)
33
{
34
return
ReadList
(
35
TypeList<LocalType>
(), invoke_context, input, read_dest,
36
[&](
auto
& value,
size_t
size) {
37
value.clear();
38
value.reserve(size);
39
},
40
[&](
auto
& value,
auto
&&...
args
) ->
decltype
(
auto
) {
41
value.emplace_back(std::forward<
decltype
(
args
)>(
args
)...);
42
return
value.back();
43
});
44
}
45
}
// namespace mp
46
47
#endif
// MP_PROXY_TYPE_VECTOR_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::BuildPrimitive
LocalType BuildPrimitive(InvokeContext &invoke_context, const Value &value, TypeList< LocalType >, typename std::enable_if< std::is_enum< Value >::value >::type *enable=nullptr)
Definition
type-number.h:12
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