mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-16 03:12:43 +00:00
31 lines
621 B
C++
31 lines
621 B
C++
#pragma once
|
|
|
|
#if USE_CAPNP
|
|
|
|
#include <Core/Block.h>
|
|
#include <capnp/dynamic.h>
|
|
#include <Formats/FormatSettings.h>
|
|
|
|
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;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|