ClickHouse/dbms/include/DB/DataStreams/NativeBlockInputStream.h
2011-08-19 19:18:15 +00:00

30 lines
896 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <DB/DataTypes/DataTypeFactory.h>
#include <DB/DataStreams/IBlockInputStream.h>
namespace DB
{
/** Десериализует поток блоков из родного бинарного формата (с именами и типами столбцов).
* Предназначено для взаимодействия между серверами.
*/
class NativeBlockInputStream : public IBlockInputStream
{
public:
NativeBlockInputStream(ReadBuffer & istr_, DataTypeFactory & data_type_factory_)
: istr(istr_), data_type_factory(data_type_factory_) {}
/** Прочитать следующий блок.
* Если блоков больше нет - вернуть пустой блок (для которого operator bool возвращает false).
*/
Block read();
private:
ReadBuffer & istr;
DataTypeFactory & data_type_factory;
};
}