From 46ebd1b240471c92f9437b41584a6e80e1d36b38 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 18 Jul 2018 04:11:48 +0300 Subject: [PATCH] Include SqliteKeyValue only in cpp. GitOrigin-RevId: b89c988f6da1d480f68ecb71ef5390e9376faac1 --- td/telegram/AnimationsManager.cpp | 6 ++++-- td/telegram/ContactsManager.cpp | 1 + td/telegram/Global.cpp | 2 ++ td/telegram/Global.h | 4 ---- td/telegram/HashtagHints.cpp | 1 + td/telegram/MessagesManager.cpp | 1 + td/telegram/SecretChatDb.h | 3 +-- td/telegram/StickersManager.cpp | 8 +++++--- td/telegram/TdDb.cpp | 5 ++++- td/telegram/TdDb.h | 5 +---- td/telegram/WebPagesManager.cpp | 9 +++++---- tddb/td/db/Pmc.h | 7 ------- 12 files changed, 25 insertions(+), 27 deletions(-) diff --git a/td/telegram/AnimationsManager.cpp b/td/telegram/AnimationsManager.cpp index d7f2cc9a..dd0ab610 100644 --- a/td/telegram/AnimationsManager.cpp +++ b/td/telegram/AnimationsManager.cpp @@ -6,8 +6,6 @@ // #include "td/telegram/AnimationsManager.h" -#include "td/actor/PromiseFuture.h" - #include "td/telegram/AuthManager.h" #include "td/telegram/DialogId.h" #include "td/telegram/DocumentsManager.h" @@ -21,6 +19,10 @@ #include "td/telegram/td_api.h" #include "td/telegram/telegram_api.h" +#include "td/actor/PromiseFuture.h" + +#include "td/db/SqliteKeyValueAsync.h" + #include "td/utils/logging.h" #include "td/utils/misc.h" #include "td/utils/Random.h" diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index df2768c3..59d8d3fa 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -14,6 +14,7 @@ #include "td/actor/SleepActor.h" #include "td/db/binlog/BinlogHelper.h" +#include "td/db/SqliteKeyValueAsync.h" #include "td/telegram/AuthManager.h" #include "td/telegram/ConfigShared.h" diff --git a/td/telegram/Global.cpp b/td/telegram/Global.cpp index db118094..992b5ae9 100644 --- a/td/telegram/Global.cpp +++ b/td/telegram/Global.cpp @@ -15,6 +15,8 @@ #include "td/actor/PromiseFuture.h" +#include "td/db/Pmc.h" + #include "td/utils/format.h" #include "td/utils/port/Clocks.h" #include "td/utils/tl_helpers.h" diff --git a/td/telegram/Global.h b/td/telegram/Global.h index 4b7f69d2..4c5cf6b2 100644 --- a/td/telegram/Global.h +++ b/td/telegram/Global.h @@ -17,10 +17,6 @@ #include "td/actor/PromiseFuture.h" #include "td/actor/SchedulerLocalStorage.h" -#include "td/db/binlog/ConcurrentBinlog.h" -#include "td/db/BinlogKeyValue.h" -#include "td/db/Pmc.h" - #include "td/net/NetStats.h" #include "td/utils/common.h" diff --git a/td/telegram/HashtagHints.cpp b/td/telegram/HashtagHints.cpp index 416835eb..8ba4faf2 100644 --- a/td/telegram/HashtagHints.cpp +++ b/td/telegram/HashtagHints.cpp @@ -7,6 +7,7 @@ #include "td/telegram/HashtagHints.h" #include "td/db/Pmc.h" +#include "td/db/SqliteKeyValueAsync.h" #include "td/telegram/Global.h" #include "td/utils/logging.h" diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index cfc8198f..16a057a5 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -60,6 +60,7 @@ #include "td/actor/SleepActor.h" #include "td/db/binlog/BinlogHelper.h" +#include "td/db/SqliteKeyValueAsync.h" #include "td/utils/format.h" #include "td/utils/HttpUrl.h" diff --git a/td/telegram/SecretChatDb.h b/td/telegram/SecretChatDb.h index df971777..a70ed689 100644 --- a/td/telegram/SecretChatDb.h +++ b/td/telegram/SecretChatDb.h @@ -7,8 +7,6 @@ #pragma once #include "td/db/KeyValueSyncInterface.h" -#include "td/db/Pmc.h" -#include "td/db/SqliteDb.h" #include "td/utils/logging.h" #include "td/utils/Status.h" @@ -17,6 +15,7 @@ #include namespace td { + class SecretChatDb { public: SecretChatDb(std::shared_ptr pmc, int32 chat_id); diff --git a/td/telegram/StickersManager.cpp b/td/telegram/StickersManager.cpp index 6e909a70..d4ce11ba 100644 --- a/td/telegram/StickersManager.cpp +++ b/td/telegram/StickersManager.cpp @@ -10,9 +10,6 @@ #include "td/telegram/td_api.h" #include "td/telegram/telegram_api.h" -#include "td/actor/MultiPromise.h" -#include "td/actor/PromiseFuture.h" - #include "td/telegram/AccessRights.h" #include "td/telegram/AuthManager.h" #include "td/telegram/ConfigShared.h" @@ -28,6 +25,11 @@ #include "td/telegram/StickersManager.hpp" #include "td/telegram/Td.h" +#include "td/actor/MultiPromise.h" +#include "td/actor/PromiseFuture.h" + +#include "td/db/SqliteKeyValueAsync.h" + #include "td/utils/format.h" #include "td/utils/logging.h" #include "td/utils/misc.h" diff --git a/td/telegram/TdDb.cpp b/td/telegram/TdDb.cpp index c602f6aa..ba699b76 100644 --- a/td/telegram/TdDb.cpp +++ b/td/telegram/TdDb.cpp @@ -16,6 +16,9 @@ #include "td/actor/MultiPromise.h" #include "td/db/BinlogKeyValue.h" +#include "td/db/SqliteKeyValue.h" +#include "td/db/SqliteKeyValueAsync.h" +#include "td/db/SqliteKeyValueSafe.h" #include "td/utils/logging.h" #include "td/utils/port/path.h" @@ -144,7 +147,7 @@ BinlogPmcPtr TdDb::get_config_pmc() { return config_pmc_.get(); } -BigPmcPtr TdDb::get_sqlite_sync_pmc() { +SqliteKeyValue *TdDb::get_sqlite_sync_pmc() { CHECK(common_kv_safe_); return &common_kv_safe_->get(); } diff --git a/td/telegram/TdDb.h b/td/telegram/TdDb.h index aa114b77..ddce5750 100644 --- a/td/telegram/TdDb.h +++ b/td/telegram/TdDb.h @@ -14,9 +14,6 @@ #include "td/db/BinlogKeyValue.h" #include "td/db/DbKey.h" #include "td/db/Pmc.h" -#include "td/db/SqliteKeyValue.h" -#include "td/db/SqliteKeyValueAsync.h" -#include "td/db/SqliteKeyValueSafe.h" #include "td/telegram/TdParameters.h" @@ -77,7 +74,7 @@ class TdDb { BinlogPmcPtr get_binlog_pmc(); BinlogPmcPtr get_config_pmc(); - BigPmcPtr get_sqlite_sync_pmc(); + SqliteKeyValue *get_sqlite_sync_pmc(); SqliteKeyValueAsyncInterface *get_sqlite_pmc(); CSlice binlog_path() const; CSlice sqlite_path() const; diff --git a/td/telegram/WebPagesManager.cpp b/td/telegram/WebPagesManager.cpp index 127487fa..777a036a 100644 --- a/td/telegram/WebPagesManager.cpp +++ b/td/telegram/WebPagesManager.cpp @@ -9,10 +9,6 @@ #include "td/telegram/secret_api.h" #include "td/telegram/telegram_api.hpp" -#include "td/actor/PromiseFuture.h" - -#include "td/db/binlog/BinlogHelper.h" - #include "td/telegram/AnimationsManager.h" #include "td/telegram/AnimationsManager.hpp" #include "td/telegram/AudiosManager.h" @@ -40,6 +36,11 @@ #include "td/telegram/VoiceNotesManager.h" #include "td/telegram/VoiceNotesManager.hpp" +#include "td/actor/PromiseFuture.h" + +#include "td/db/binlog/BinlogHelper.h" +#include "td/db/SqliteKeyValueAsync.h" + #include "td/utils/buffer.h" #include "td/utils/logging.h" #include "td/utils/misc.h" diff --git a/tddb/td/db/Pmc.h b/tddb/td/db/Pmc.h index dcf0e0c3..9fd0c820 100644 --- a/tddb/td/db/Pmc.h +++ b/tddb/td/db/Pmc.h @@ -8,9 +8,6 @@ #include "td/db/binlog/ConcurrentBinlog.h" #include "td/db/BinlogKeyValue.h" -#include "td/db/SqliteKeyValue.h" - -#include "td/utils/common.h" #include @@ -20,8 +17,4 @@ using BinlogPmcBase = BinlogKeyValue; using BinlogPmc = std::shared_ptr; using BinlogPmcPtr = BinlogPmcBase *; -using BigPmcBase = SqliteKeyValue; -using BigPmc = std::unique_ptr; -using BigPmcPtr = BigPmcBase *; - }; // namespace td