6 #ifndef KAGOME_ADAPTERS_PROTOBUF 7 #define KAGOME_ADAPTERS_PROTOBUF 9 #include <boost/system/error_code.hpp> 15 #include "network/protobuf/api.v1.pb.h" 26 std::vector<uint8_t> &out,
27 std::vector<uint8_t>::iterator loaded) {
28 const size_t distance_was = std::distance(out.begin(), loaded);
29 const size_t was_size = out.size();
31 out.resize(was_size + msg.ByteSizeLong());
32 msg.SerializeToArray(&out[was_size], msg.ByteSizeLong());
34 auto res_it = out.begin();
35 std::advance(res_it, std::min(distance_was, was_size));
41 #endif // KAGOME_ADAPTERS_PROTOBUF std::vector< uint8_t >::iterator appendToVec(const T &msg, std::vector< uint8_t > &out, std::vector< uint8_t >::iterator loaded)