2023-05-10 18:39:38 +00:00
|
|
|
#pragma once
|
|
|
|
|
2023-05-11 12:08:50 +00:00
|
|
|
#if USE_CAPNP
|
|
|
|
|
2023-05-10 18:39:38 +00:00
|
|
|
#include <Core/Block.h>
|
|
|
|
#include <capnp/dynamic.h>
|
2023-05-25 15:24:02 +00:00
|
|
|
#include <Formats/FormatSettings.h>
|
2023-05-10 18:39:38 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class CapnProtoSerializer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CapnProtoSerializer(const DataTypes & data_types, const Names & names, const capnp::StructSchema & schema, const FormatSettings::CapnProto & settings);
|
|
|
|
|
|
|
|
void writeRow(const Columns & columns, capnp::DynamicStruct::Builder builder, size_t row_num);
|
|
|
|
|
|
|
|
void readRow(MutableColumns & columns, capnp::DynamicStruct::Reader & reader);
|
|
|
|
|
|
|
|
~CapnProtoSerializer();
|
|
|
|
|
|
|
|
private:
|
|
|
|
class Impl;
|
|
|
|
std::unique_ptr<Impl> serializer_impl;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
2023-05-11 12:08:50 +00:00
|
|
|
|
|
|
|
#endif
|