2014-04-08 06:51:53 +00:00
|
|
|
|
#pragma once
|
2011-05-16 16:31:19 +00:00
|
|
|
|
|
2015-12-24 21:28:18 +00:00
|
|
|
|
#include <atomic>
|
2016-03-01 17:47:53 +00:00
|
|
|
|
#include <functional>
|
2015-12-24 21:28:18 +00:00
|
|
|
|
|
2011-05-16 16:31:19 +00:00
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
|
{
|
|
|
|
|
|
2016-02-16 16:39:39 +00:00
|
|
|
|
class ReadBuffer;
|
|
|
|
|
class WriteBuffer;
|
|
|
|
|
|
|
|
|
|
|
2015-12-24 21:28:18 +00:00
|
|
|
|
/** Копирует данные из ReadBuffer в WriteBuffer, все что есть.
|
2011-05-16 16:31:19 +00:00
|
|
|
|
*/
|
|
|
|
|
void copyData(ReadBuffer & from, WriteBuffer & to);
|
|
|
|
|
|
2015-12-24 21:28:18 +00:00
|
|
|
|
/** Копирует bytes байт из ReadBuffer в WriteBuffer. Если нет bytes байт, то кидает исключение.
|
2014-04-02 13:45:39 +00:00
|
|
|
|
*/
|
|
|
|
|
void copyData(ReadBuffer & from, WriteBuffer & to, size_t bytes);
|
|
|
|
|
|
2015-12-24 21:28:18 +00:00
|
|
|
|
/** То же самое, с условием на остановку.
|
|
|
|
|
*/
|
|
|
|
|
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);
|
|
|
|
|
|
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);
|
2015-12-24 21:28:18 +00:00
|
|
|
|
|
2011-05-16 16:31:19 +00:00
|
|
|
|
}
|