Lines Matching refs:buffer
45 inline auto TypeToBuffer(const T &value, /* out */ std::vector<uint8_t> &buffer)
49 std::copy(ptr, ToUint8tPtr(ToUintPtr(ptr) + sizeof(value)), std::back_inserter(buffer));
55 inline auto TypeToBuffer(const VecT &vec, /* out */ std::vector<uint8_t> &buffer)
62 auto ret = TypeToBuffer(size, buffer);
70 std::copy(ptr, ptr_end, std::back_inserter(buffer));
76 inline auto TypeToBuffer(const UnMap &map, /* out */ std::vector<uint8_t> &buffer)
80 auto ret = TypeToBuffer(static_cast<uint32_t>(map.size()), buffer);
92 auto k = TypeToBuffer(it.first, buffer);
99 auto v = TypeToBuffer(it.second, buffer);
115 return Unexpected("Cannot deserialize POD type, the buffer is too small.");
137 return Unexpected("Cannot deserialize string, the buffer is too small.");
161 return Unexpected("Cannot deserialize vector, the buffer is too small.");
215 explicit Serializer(std::vector<uint8_t> &buffer) : buffer_(buffer) {}
283 bool StructToBuffer(Struct &&str, /* out */ std::vector<uint8_t> &buffer) // NOLINT(google-runtime-references)
285 internal::ForEachTuple(internal::StructToTuple<N>(std::forward<Struct>(str)), internal::Serializer(buffer));
317 bool BufferToStruct(const std::vector<uint8_t> &buffer, /* out */ Struct &str)
319 return BufferToStruct<N>(buffer.data(), buffer.size(), str);