5#include <boost/asio.hpp>
6#include <boost/asio/experimental/coro.hpp>
20 using InputFuture = boost::shared_future<std::optional<InputType>>;
21 using OutputFuture = boost::unique_future<std::optional<OutputType>>;
25 const std::string& filename,
33 throw std::runtime_error(fmt::format(
"Filename {:?} cannot be open!", filename));
51 auto write_msg = std::string_view{};
54 if (not write_msg.empty())
58 auto msg =
co_yield static_cast<int>(write_msg.size());
62 write_msg = msg.value();
67 spdlog::info(
"Binary file {} is closed successfully",
file_name_);
auto generate_coro(asio::any_io_executor) -> CoroType
auto get_convert_mode() const -> process::DataConvertOptions
std::string_view InputType
BinaryFile(asio::thread_pool &thread_pool, const std::string &filename, process::DataConvertOptions deser_mode)
auto write(auto pre_future) -> OutputFuture
process::DataConvertOptions convert_mode_
asio::experimental::coro< OutputType(std::optional< InputType >)> CoroType
boost::unique_future< std::optional< OutputType > > OutputFuture
boost::shared_future< std::optional< InputType > > InputFuture
static constexpr auto IsStructType
auto create_coro_future(auto &coro, auto &&pre_fut)
void coro_sync_start(auto &coro, auto &&... args)