mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 13:02:00 +00:00
36 lines
681 B
C++
36 lines
681 B
C++
#pragma once
|
|
|
|
#include <IO/WriteBufferFromFileBase.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
/// Delegates all writes to underlying buffer. Doesn't have own memory.
|
|
class WriteBufferFromFileDecorator : public WriteBufferFromFileBase
|
|
{
|
|
public:
|
|
explicit WriteBufferFromFileDecorator(std::unique_ptr<WriteBuffer> impl_);
|
|
|
|
~WriteBufferFromFileDecorator() override;
|
|
|
|
void sync() override;
|
|
|
|
std::string getFileName() const override;
|
|
|
|
void preFinalize() override;
|
|
|
|
const WriteBuffer & getImpl() const { return *impl; }
|
|
|
|
protected:
|
|
void finalizeImpl() override;
|
|
|
|
std::unique_ptr<WriteBuffer> impl;
|
|
|
|
private:
|
|
void nextImpl() override;
|
|
|
|
bool is_prefinalized = false;
|
|
};
|
|
|
|
}
|