2018-12-31 22:04:05 +03:00
|
|
|
//
|
2022-01-01 03:35:39 +03:00
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
|
2018-12-31 22:04:05 +03:00
|
|
|
//
|
|
|
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
//
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "td/db/binlog/BinlogEvent.h"
|
2020-06-11 02:25:50 +03:00
|
|
|
#include "td/db/binlog/BinlogInterface.h"
|
2018-12-31 22:04:05 +03:00
|
|
|
|
|
|
|
#include "td/utils/common.h"
|
2022-06-27 13:30:18 +03:00
|
|
|
#include "td/utils/Promise.h"
|
2020-06-10 22:18:22 +03:00
|
|
|
#include "td/utils/StorerBase.h"
|
2018-12-31 22:04:05 +03:00
|
|
|
|
|
|
|
namespace td {
|
2019-01-06 22:11:02 +03:00
|
|
|
|
2020-06-26 02:24:13 +03:00
|
|
|
inline uint64 binlog_add(BinlogInterface *binlog_ptr, int32 type, const Storer &storer,
|
|
|
|
Promise<> promise = Promise<>()) {
|
2020-06-11 02:25:50 +03:00
|
|
|
return binlog_ptr->add(type, storer, std::move(promise));
|
2018-06-28 16:52:40 +03:00
|
|
|
}
|
2018-12-31 22:04:05 +03:00
|
|
|
|
2020-09-22 02:15:09 +03:00
|
|
|
inline uint64 binlog_rewrite(BinlogInterface *binlog_ptr, uint64 log_event_id, int32 type, const Storer &storer,
|
2020-06-26 02:24:13 +03:00
|
|
|
Promise<> promise = Promise<>()) {
|
2020-09-22 02:15:09 +03:00
|
|
|
return binlog_ptr->rewrite(log_event_id, type, storer, std::move(promise));
|
2018-06-28 16:52:40 +03:00
|
|
|
}
|
2018-12-31 22:04:05 +03:00
|
|
|
|
2020-09-22 02:15:09 +03:00
|
|
|
inline uint64 binlog_erase(BinlogInterface *binlog_ptr, uint64 log_event_id, Promise<> promise = Promise<>()) {
|
|
|
|
return binlog_ptr->erase(log_event_id, std::move(promise));
|
2018-06-28 16:52:40 +03:00
|
|
|
}
|
2019-01-06 22:11:02 +03:00
|
|
|
|
2018-12-31 22:04:05 +03:00
|
|
|
} // namespace td
|