Forward-declare BinlogEvent.

GitOrigin-RevId: 4ea183c04ec8e5ffd0c2851db399b2a2155557ea
This commit is contained in:
levlam 2019-01-06 22:11:02 +03:00
parent c8f3573ca5
commit ea06aa19d6
10 changed files with 27 additions and 20 deletions

View File

@ -13,6 +13,7 @@
#include "td/actor/PromiseFuture.h" #include "td/actor/PromiseFuture.h"
#include "td/actor/SleepActor.h" #include "td/actor/SleepActor.h"
#include "td/db/binlog/BinlogEvent.h"
#include "td/db/binlog/BinlogHelper.h" #include "td/db/binlog/BinlogHelper.h"
#include "td/db/SqliteKeyValueAsync.h" #include "td/db/SqliteKeyValueAsync.h"

View File

@ -9,13 +9,6 @@
#include "td/telegram/td_api.h" #include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h" #include "td/telegram/telegram_api.h"
#include "td/actor/actor.h"
#include "td/actor/MultiPromise.h"
#include "td/actor/PromiseFuture.h"
#include "td/actor/Timeout.h"
#include "td/db/binlog/BinlogEvent.h"
#include "td/telegram/AccessRights.h" #include "td/telegram/AccessRights.h"
#include "td/telegram/ChannelId.h" #include "td/telegram/ChannelId.h"
#include "td/telegram/ChatId.h" #include "td/telegram/ChatId.h"
@ -28,6 +21,11 @@
#include "td/telegram/SecretChatId.h" #include "td/telegram/SecretChatId.h"
#include "td/telegram/UserId.h" #include "td/telegram/UserId.h"
#include "td/actor/actor.h"
#include "td/actor/MultiPromise.h"
#include "td/actor/PromiseFuture.h"
#include "td/actor/Timeout.h"
#include "td/utils/common.h" #include "td/utils/common.h"
#include "td/utils/Hints.h" #include "td/utils/Hints.h"
#include "td/utils/Slice.h" #include "td/utils/Slice.h"
@ -41,6 +39,8 @@
namespace td { namespace td {
struct BinlogEvent;
class Td; class Td;
struct BotData { struct BotData {

View File

@ -47,6 +47,7 @@
#include "td/actor/PromiseFuture.h" #include "td/actor/PromiseFuture.h"
#include "td/actor/SleepActor.h" #include "td/actor/SleepActor.h"
#include "td/db/binlog/BinlogEvent.h"
#include "td/db/binlog/BinlogHelper.h" #include "td/db/binlog/BinlogHelper.h"
#include "td/db/SqliteKeyValueAsync.h" #include "td/db/SqliteKeyValueAsync.h"

View File

@ -34,8 +34,6 @@
#include "td/telegram/SecretInputMedia.h" #include "td/telegram/SecretInputMedia.h"
#include "td/telegram/UserId.h" #include "td/telegram/UserId.h"
#include "td/db/binlog/BinlogEvent.h"
#include "td/actor/actor.h" #include "td/actor/actor.h"
#include "td/actor/MultiPromise.h" #include "td/actor/MultiPromise.h"
#include "td/actor/PromiseFuture.h" #include "td/actor/PromiseFuture.h"
@ -63,6 +61,8 @@
namespace td { namespace td {
struct BinlogEvent;
class Td; class Td;
class MultiSequenceDispatcher; class MultiSequenceDispatcher;

View File

@ -6,8 +6,6 @@
// //
#include "td/telegram/SecretChatsManager.h" #include "td/telegram/SecretChatsManager.h"
#include "td/actor/PromiseFuture.h"
#include "td/telegram/ConfigShared.h" #include "td/telegram/ConfigShared.h"
#include "td/telegram/ContactsManager.h" #include "td/telegram/ContactsManager.h"
#include "td/telegram/DhCache.h" #include "td/telegram/DhCache.h"
@ -22,6 +20,10 @@
#include "td/telegram/secret_api.h" #include "td/telegram/secret_api.h"
#include "td/telegram/telegram_api.hpp" #include "td/telegram/telegram_api.hpp"
#include "td/actor/PromiseFuture.h"
#include "td/db/binlog/BinlogEvent.h"
#include "td/utils/format.h" #include "td/utils/format.h"
#include "td/utils/logging.h" #include "td/utils/logging.h"
#include "td/utils/misc.h" #include "td/utils/misc.h"

View File

@ -17,14 +17,15 @@
#include "td/actor/actor.h" #include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h" #include "td/actor/PromiseFuture.h"
#include "td/db/binlog/BinlogEvent.h"
#include "td/utils/Time.h" #include "td/utils/Time.h"
#include <map> #include <map>
#include <utility> #include <utility>
namespace td { namespace td {
struct BinlogEvent;
class SecretChatsManager : public Actor { class SecretChatsManager : public Actor {
public: public:
explicit SecretChatsManager(ActorShared<> parent); explicit SecretChatsManager(ActorShared<> parent);

View File

@ -50,11 +50,6 @@ class TdDb {
TdDb &operator=(TdDb &&) = delete; TdDb &operator=(TdDb &&) = delete;
~TdDb(); ~TdDb();
struct Events;
static Result<unique_ptr<TdDb>> open(int32 scheduler_id, const TdParameters &parameters, DbKey key, Events &events);
static Result<EncryptionInfo> check_encryption(const TdParameters &parameters);
static Status destroy(const TdParameters &parameters);
struct Events { struct Events {
vector<BinlogEvent> to_secret_chats_manager; vector<BinlogEvent> to_secret_chats_manager;
vector<BinlogEvent> user_events; vector<BinlogEvent> user_events;
@ -65,6 +60,10 @@ class TdDb {
vector<BinlogEvent> to_messages_manager; vector<BinlogEvent> to_messages_manager;
}; };
static Result<unique_ptr<TdDb>> open(int32 scheduler_id, const TdParameters &parameters, DbKey key, Events &events);
static Result<EncryptionInfo> check_encryption(const TdParameters &parameters);
static Status destroy(const TdParameters &parameters);
std::shared_ptr<FileDbInterface> get_file_db_shared(); std::shared_ptr<FileDbInterface> get_file_db_shared();
std::shared_ptr<SqliteConnectionSafe> &get_sqlite_connection_safe(); std::shared_ptr<SqliteConnectionSafe> &get_sqlite_connection_safe();
ConcurrentBinlog *get_binlog(); ConcurrentBinlog *get_binlog();

View File

@ -38,6 +38,7 @@
#include "td/actor/PromiseFuture.h" #include "td/actor/PromiseFuture.h"
#include "td/db/binlog/BinlogEvent.h"
#include "td/db/binlog/BinlogHelper.h" #include "td/db/binlog/BinlogHelper.h"
#include "td/db/SqliteKeyValueAsync.h" #include "td/db/SqliteKeyValueAsync.h"

View File

@ -19,8 +19,6 @@
#include "td/actor/PromiseFuture.h" #include "td/actor/PromiseFuture.h"
#include "td/actor/Timeout.h" #include "td/actor/Timeout.h"
#include "td/db/binlog/BinlogEvent.h"
#include "td/utils/common.h" #include "td/utils/common.h"
#include "td/utils/Status.h" #include "td/utils/Status.h"
@ -30,6 +28,8 @@
namespace td { namespace td {
struct BinlogEvent;
class Td; class Td;
class WebPagesManager : public Actor { class WebPagesManager : public Actor {

View File

@ -14,6 +14,7 @@
#include "td/utils/Storer.h" #include "td/utils/Storer.h"
namespace td { namespace td {
template <class BinlogT, class StorerT> template <class BinlogT, class StorerT>
uint64 binlog_add(const BinlogT &binlog_ptr, int32 type, const StorerT &storer, Promise<> promise = Promise<>()) { uint64 binlog_add(const BinlogT &binlog_ptr, int32 type, const StorerT &storer, Promise<> promise = Promise<>()) {
auto logevent_id = binlog_ptr->next_id(); auto logevent_id = binlog_ptr->next_id();
@ -42,4 +43,5 @@ uint64 binlog_erase_impl(BinlogDebugInfo info, const BinlogT &binlog_ptr, uint64
std::move(promise)); std::move(promise));
return seq_no; return seq_no;
} }
} // namespace td } // namespace td