| 1013 | |
| 1014 | template <typename DType> |
| 1015 | void TypedStatisticsImpl<DType>::PlainEncode(const T& src, std::string* dst) const { |
| 1016 | auto encoder = MakeTypedEncoder<DType>(Encoding::PLAIN, false, descr_, pool_); |
| 1017 | encoder->Put(&src, 1); |
| 1018 | auto buffer = encoder->FlushValues(); |
| 1019 | auto ptr = reinterpret_cast<const char*>(buffer->data()); |
| 1020 | dst->assign(ptr, static_cast<size_t>(buffer->size())); |
| 1021 | } |
| 1022 | |
| 1023 | template <typename DType> |
| 1024 | void TypedStatisticsImpl<DType>::PlainDecode(const std::string& src, T* dst) const { |