mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 03:42:48 +00:00
34 lines
585 B
C++
34 lines
585 B
C++
#pragma once
|
|
|
|
#include <Processors/IProcessor.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class ISource : public IProcessor
|
|
{
|
|
protected:
|
|
OutputPort & output;
|
|
bool has_input = false;
|
|
bool finished = false;
|
|
bool got_exception = false;
|
|
Port::Data current_chunk;
|
|
|
|
virtual Chunk generate();
|
|
virtual std::optional<Chunk> tryGenerate();
|
|
|
|
public:
|
|
ISource(Block header);
|
|
|
|
Status prepare() override;
|
|
void work() override;
|
|
|
|
OutputPort & getPort() { return output; }
|
|
const OutputPort & getPort() const { return output; }
|
|
};
|
|
|
|
using SourcePtr = std::shared_ptr<ISource>;
|
|
|
|
}
|