Bitcoin Core
28.99.0
P2P Digital Currency
src
netmessagemaker.h
Go to the documentation of this file.
1
// Copyright (c) 2009-2010 Satoshi Nakamoto
2
// Copyright (c) 2009-2020 The Bitcoin Core developers
3
// Distributed under the MIT software license, see the accompanying
4
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
6
#ifndef BITCOIN_NETMESSAGEMAKER_H
7
#define BITCOIN_NETMESSAGEMAKER_H
8
9
#include <
net.h
>
10
#include <
serialize.h
>
11
12
namespace
NetMsg
{
13
template
<
typename
... Args>
14
CSerializedNetMsg
Make
(std::string msg_type, Args&&...
args
)
15
{
16
CSerializedNetMsg
msg
;
17
msg
.m_type = std::move(msg_type);
18
VectorWriter
{
msg
.data, 0, std::forward<Args>(
args
)...};
19
return
msg
;
20
}
21
}
// namespace NetMsg
22
23
#endif
// BITCOIN_NETMESSAGEMAKER_H
args
ArgsManager & args
Definition:
bitcoind.cpp:277
VectorWriter
Definition:
streams.h:53
NetMsg
Definition:
netmessagemaker.h:12
NetMsg::Make
CSerializedNetMsg Make(std::string msg_type, Args &&... args)
Definition:
netmessagemaker.h:14
tests_wycheproof_generate.msg
def msg
Definition:
tests_wycheproof_generate.py:56
serialize.h
CSerializedNetMsg
Definition:
net.h:114
net.h
Generated on Wed Dec 18 2024 20:00:10 for Bitcoin Core by
1.9.4