std::enable_if_t<(std::is_integral<T>::value || std::is_enum<T>::value) && !std::is_same<T, uint32_t>::value && !std::is_same<T, uint64_t>::value && !std::is_same<T, int32_t>::value && !std::is_same<T, int64_t>::value> operator()(T const & t, char const * /* name */ = nullptr) { WriteToSink(m_sink, t); }
void QuerySaver::Serialize(string & data) const { vector<uint8_t> rawData; MemWriter<vector<uint8_t>> writer(rawData); TLength size = m_topQueries.size(); WriteToSink(writer, size); for (auto const & query : m_topQueries) { size = query.first.size(); WriteToSink(writer, size); writer.Write(query.first.c_str(), size); size = query.second.size(); WriteToSink(writer, size); writer.Write(query.second.c_str(), size); } data = base64::Encode(string(rawData.begin(), rawData.end())); }
// static void Serdes::SerializeInfo(Info const & info, std::vector<int8_t> & result) { result.clear(); using Sink = MemWriter<std::vector<int8_t>>; Sink writer(result); WriteToSink(writer, static_cast<int8_t>(Info::GetVersion())); coding::SerializerJson<Sink> ser(writer); ser(info); }
void Serialize(TWriter & writer, TValue const & v) const { serial::SavePoint(writer, v.m_pt, m_codingParams); WriteToSink(writer, v.m_featureId); WriteToSink(writer, v.m_rank); }
void Serialize(TWriter & writer, TValue const & v) const { WriteToSink(writer, v.m_featureId); }
void WriteRawData(FileWriter & writer, std::vector<uint8_t> const & rawData) { uint64_t const size = static_cast<uint64_t>(rawData.size()); WriteToSink(writer, size); writer.Write(rawData.data(), size); }
void WriteZigZag(FileWriter & writer, int64_t duration) { uint64_t const encoded = bits::ZigZagEncode(duration); WriteToSink(writer, encoded); }