Skip to content

Commit

Permalink
Forward-declare SqliteConnectionSafe and SqliteDb. Finally, all DB us…
Browse files Browse the repository at this point in the history
…ages are private.

GitOrigin-RevId: 63d904c6ba9e3896f46ce8844e328f77c7e50553
  • Loading branch information
levlam committed Jan 7, 2019
1 parent 9bdc13e commit a062fa4
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 5 deletions.
1 change: 1 addition & 0 deletions benchmark/bench_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "td/db/binlog/ConcurrentBinlog.h"
#include "td/db/BinlogKeyValue.h"
#include "td/db/SeqKeyValue.h"
#include "td/db/SqliteConnectionSafe.h"
#include "td/db/SqliteDb.h"
#include "td/db/SqliteKeyValueAsync.h"

Expand Down
4 changes: 3 additions & 1 deletion benchmark/bench_tddb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"

#include "td/db/SqliteConnectionSafe.h"

#include "td/utils/benchmark.h"
#include "td/utils/buffer.h"
#include "td/utils/common.h"
Expand Down Expand Up @@ -77,7 +79,7 @@ class MessagesDbBench : public Benchmark {
}

private:
td::unique_ptr<td::ConcurrentScheduler> scheduler_;
td::unique_ptr<ConcurrentScheduler> scheduler_;
std::shared_ptr<SqliteConnectionSafe> sql_connection_;
std::shared_ptr<MessagesDbSyncSafeInterface> messages_db_sync_safe_;
std::shared_ptr<MessagesDbAsyncInterface> messages_db_async_;
Expand Down
1 change: 1 addition & 0 deletions td/telegram/DialogDb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "td/actor/actor.h"
#include "td/actor/SchedulerLocalStorage.h"

#include "td/db/SqliteConnectionSafe.h"
#include "td/db/SqliteDb.h"
#include "td/db/SqliteKeyValue.h"
#include "td/db/SqliteStatement.h"
Expand Down
7 changes: 5 additions & 2 deletions td/telegram/DialogDb.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

#include "td/actor/PromiseFuture.h"

#include "td/db/SqliteConnectionSafe.h"

#include "td/utils/buffer.h"
#include "td/utils/common.h"
#include "td/utils/Status.h"
Expand All @@ -22,6 +20,10 @@
#include <utility>

namespace td {

class SqliteConnectionSafe;
class SqliteDb;

class DialogDbSyncInterface {
public:
DialogDbSyncInterface() = default;
Expand Down Expand Up @@ -87,4 +89,5 @@ std::shared_ptr<DialogDbSyncSafeInterface> create_dialog_db_sync(

std::shared_ptr<DialogDbAsyncInterface> create_dialog_db_async(std::shared_ptr<DialogDbSyncSafeInterface> sync_db,
int32 scheduler_id);

} // namespace td
1 change: 1 addition & 0 deletions td/telegram/MessagesDb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "td/telegram/logevent/LogEvent.h"
#include "td/telegram/Version.h"

#include "td/db/SqliteConnectionSafe.h"
#include "td/db/SqliteDb.h"
#include "td/db/SqliteStatement.h"

Expand Down
5 changes: 3 additions & 2 deletions td/telegram/MessagesDb.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

#include "td/actor/PromiseFuture.h"

#include "td/db/SqliteConnectionSafe.h"

#include "td/utils/buffer.h"
#include "td/utils/common.h"
#include "td/utils/logging.h"
Expand All @@ -24,6 +22,9 @@

namespace td {

class SqliteConnectionSafe;
class SqliteDb;

// append only before Size
enum class SearchMessagesFilter : int32 {
Empty,
Expand Down
1 change: 1 addition & 0 deletions td/telegram/TdDb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "td/db/binlog/Binlog.h"
#include "td/db/binlog/ConcurrentBinlog.h"
#include "td/db/BinlogKeyValue.h"
#include "td/db/SqliteConnectionSafe.h"
#include "td/db/SqliteKeyValue.h"
#include "td/db/SqliteKeyValueAsync.h"
#include "td/db/SqliteKeyValueSafe.h"
Expand Down
1 change: 1 addition & 0 deletions td/telegram/files/FileDb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "td/actor/actor.h"

#include "td/db/SqliteConnectionSafe.h"
#include "td/db/SqliteKeyValue.h"
#include "td/db/SqliteKeyValueSafe.h"

Expand Down
1 change: 1 addition & 0 deletions test/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//
#include "td/db/binlog/BinlogHelper.h"
#include "td/db/binlog/ConcurrentBinlog.h"
#include "td/db/SqliteConnectionSafe.h"
#include "td/db/BinlogKeyValue.h"
#include "td/db/SeqKeyValue.h"
#include "td/db/SqliteKeyValue.h"
Expand Down

0 comments on commit a062fa4

Please sign in to comment.