2018-05-23 20:19:33 +00:00
|
|
|
#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;
|
2018-05-23 20:19:33 +00:00
|
|
|
bool finished = false;
|
2019-02-18 16:36:07 +00:00
|
|
|
Chunk current_chunk;
|
2018-05-23 20:19:33 +00:00
|
|
|
|
2019-02-18 16:36:07 +00:00
|
|
|
virtual Chunk generate() = 0;
|
2018-05-23 20:19:33 +00:00
|
|
|
|
|
|
|
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; }
|
2018-05-23 20:19:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|