ClickHouse/dbms/IO/copyData.h

31 lines
865 B
C++
Raw Normal View History

2014-04-08 06:51:53 +00:00
#pragma once
#include <atomic>
2016-03-01 17:47:53 +00:00
#include <functional>
namespace DB
{
class ReadBuffer;
class WriteBuffer;
2017-05-28 14:29:40 +00:00
/** Copies data from ReadBuffer to WriteBuffer, all that is.
*/
void copyData(ReadBuffer & from, WriteBuffer & to);
2017-05-28 14:29:40 +00:00
/** Copies `bytes` bytes from ReadBuffer to WriteBuffer. If there are no `bytes` bytes, then throws an exception.
2014-04-02 13:45:39 +00:00
*/
void copyData(ReadBuffer & from, WriteBuffer & to, size_t bytes);
2017-05-28 14:29:40 +00:00
/** The same, with the condition to cancel.
*/
2018-05-25 11:45:19 +00:00
void copyData(ReadBuffer & from, WriteBuffer & to, const std::atomic<int> & is_cancelled);
void copyData(ReadBuffer & from, WriteBuffer & to, size_t bytes, const std::atomic<int> & is_cancelled);
2016-03-01 17:47:53 +00:00
void copyData(ReadBuffer & from, WriteBuffer & to, std::function<void()> cancellation_hook);
void copyData(ReadBuffer & from, WriteBuffer & to, size_t bytes, std::function<void()> cancellation_hook);
}