Bitcoin Core
31.1.0
P2P Digital Currency
Toggle main menu visibility
Loading...
Searching...
No Matches
src
ipc
libmultiprocess
include
mp
type-char.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_CHAR_H
6
#define MP_PROXY_TYPE_CHAR_H
7
8
#include <
mp/util.h
>
9
10
namespace
mp
{
11
template
<
typename
Output,
size_t
size>
12
void
CustomBuildField
(
TypeList<const unsigned char*>
,
13
Priority<3>
,
14
InvokeContext
& invoke_context,
15
const
unsigned
char
(&value)[size],
16
Output&& output)
17
{
18
auto
result = output.init(size);
19
memcpy(result.begin(), value, size);
20
}
21
22
template
<
size_t
size,
typename
Input,
typename
ReadDest>
23
decltype
(
auto
)
CustomReadField
(
TypeList
<
unsigned
char
[size]>,
24
Priority<1>
,
25
InvokeContext
& invoke_context,
26
Input&& input,
27
ReadDest&& read_dest)
28
{
29
return
read_dest.update([&](
auto
& value) {
30
auto
data = input.get();
31
memcpy(value, data.begin(), size);
32
});
33
}
34
}
// namespace mp
35
36
#endif
// MP_PROXY_TYPE_CHAR_H
util.h
mp
Functions to serialize / deserialize common bitcoin types.
Definition
common-types.h:57
mp::CustomReadField
decltype(auto) CustomReadField(TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
Definition
common-types.h:83
mp::CustomBuildField
void CustomBuildField(TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output)
Definition
common-types.h:63
mp::InvokeContext
Definition
proxy-io.h:30
mp::Priority
Definition
util.h:109
mp::TypeList
Generic utility functions used by capnp code.
Definition
util.h:33
Generated on
for Bitcoin Core by
1.17.0