From 2ec935dcaab9557addcf73c33aa7f2db8cc01fee Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 10 Nov 2016 17:05:23 -0500 Subject: net: add CVectorWriter and CNetMsgMaker CVectorWriter is useful for overwriting or appending an existing byte vector. CNetMsgMaker is a shortcut for creating messages on-the-fly which are suitable for pushing to CConnman. --- src/net.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/net.h') diff --git a/src/net.h b/src/net.h index 7a32e21f4a..9ea056c6ee 100644 --- a/src/net.h +++ b/src/net.h @@ -101,6 +101,20 @@ class CTransaction; class CNodeStats; class CClientUIInterface; +struct CSerializedNetMsg +{ + CSerializedNetMsg() = default; + CSerializedNetMsg(CSerializedNetMsg&&) = default; + CSerializedNetMsg& operator=(CSerializedNetMsg&&) = default; + // No copying, only moves. + CSerializedNetMsg(const CSerializedNetMsg& msg) = delete; + CSerializedNetMsg& operator=(const CSerializedNetMsg&) = delete; + + std::vector data; + std::string command; +}; + + class CConnman { public: -- cgit v1.2.3