ClickHouse/dbms/include/DB/DataStreams/NativeBlockInputStream.h
2013-05-04 04:05:15 +00:00

37 lines
879 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/IProfilingBlockInputStream.h>
namespace DB
{
/** Десериализует поток блоков из родного бинарного формата (с именами и типами столбцов).
* Предназначено для взаимодействия между серверами.
*/
class NativeBlockInputStream : public IProfilingBlockInputStream
{
public:
NativeBlockInputStream(ReadBuffer & istr_, const DataTypeFactory & data_type_factory_)
: istr(istr_), data_type_factory(data_type_factory_) {}
String getName() const { return "NativeBlockInputStream"; }
String getID() const
{
std::stringstream res;
res << this;
return res.str();
}
protected:
Block readImpl();
private:
ReadBuffer & istr;
const DataTypeFactory & data_type_factory;
};
}