ClickHouse/dbms/include/DB/IO/copyData.h
Alexey Arno 6efc98d1f3 Merge
2016-03-01 20:47:53 +03:00

31 lines
937 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <atomic>
#include <functional>
namespace DB
{
class ReadBuffer;
class WriteBuffer;
/** Копирует данные из ReadBuffer в WriteBuffer, все что есть.
*/
void copyData(ReadBuffer & from, WriteBuffer & to);
/** Копирует bytes байт из ReadBuffer в WriteBuffer. Если нет bytes байт, то кидает исключение.
*/
void copyData(ReadBuffer & from, WriteBuffer & to, size_t bytes);
/** То же самое, с условием на остановку.
*/
void copyData(ReadBuffer & from, WriteBuffer & to, std::atomic<bool> & is_cancelled);
void copyData(ReadBuffer & from, WriteBuffer & to, size_t bytes, std::atomic<bool> & is_cancelled);
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);
}