ClickHouse/src/Processors/ISource.h

34 lines
585 B
C++
Raw Normal View History

#pragma once
#include <Processors/IProcessor.h>
namespace DB
{
class ISource : public IProcessor
{
protected:
OutputPort & output;
2019-02-07 18:51:53 +00:00
bool has_input = false;
bool finished = false;
bool got_exception = false;
2019-04-29 18:43:50 +00:00
Port::Data current_chunk;
2020-12-04 10:52:57 +00:00
virtual Chunk generate();
virtual std::optional<Chunk> tryGenerate();
public:
ISource(Block header);
Status prepare() override;
void work() override;
OutputPort & getPort() { return output; }
2019-02-19 18:41:18 +00:00
const OutputPort & getPort() const { return output; }
};
using SourcePtr = std::shared_ptr<ISource>;
}