Remove payload copy in all outgoing p2p messages

This commit is contained in:
Lee Clagett 2020-10-13 09:27:20 +00:00
parent 0b6bfb1fd8
commit 23aae5571b
20 changed files with 319 additions and 215 deletions

View file

@ -34,6 +34,7 @@
namespace epee
{
class byte_slice;
class byte_stream;
namespace serialization
{
/************************************************************************/
@ -83,8 +84,13 @@ namespace epee
//-------------------------------------------------------------------------------
bool store_to_binary(byte_slice& target, std::size_t initial_buffer_size = 8192);
bool load_from_binary(const epee::span<const uint8_t> target, const limits_t *limits = NULL);
bool load_from_binary(const std::string& target, const limits_t *limits = NULL);
bool store_to_binary(byte_stream& ss);
bool load_from_binary(const epee::span<const uint8_t> target, const limits_t *limits = nullptr);
bool load_from_binary(const std::string& target, const limits_t *limits = nullptr)
{
return load_from_binary(epee::strspan<uint8_t>(target), limits);
}
template<class trace_policy>
bool dump_as_xml(std::string& targetObj, const std::string& root_name = "");
bool dump_as_json(std::string& targetObj, size_t indent = 0, bool insert_newlines = true);