From d1dae35b85634358a4c3ae9b47f1bc097b881e3d Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 19 Sep 2023 21:24:19 +0300 Subject: [PATCH] Add empty StatisticsManager. --- CMakeLists.txt | 2 ++ SplitSource.php | 1 + td/telegram/StatisticsManager.cpp | 18 ++++++++++++++++++ td/telegram/StatisticsManager.h | 28 ++++++++++++++++++++++++++++ td/telegram/Td.cpp | 7 +++++++ td/telegram/Td.h | 3 +++ 6 files changed, 59 insertions(+) create mode 100644 td/telegram/StatisticsManager.cpp create mode 100644 td/telegram/StatisticsManager.h diff --git a/CMakeLists.txt b/CMakeLists.txt index d95c9e8ae..49c0b674c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -469,6 +469,7 @@ set(TDLIB_SOURCE td/telegram/SpecialStickerSetType.cpp td/telegram/SponsoredMessageManager.cpp td/telegram/StateManager.cpp + td/telegram/StatisticsManager.cpp td/telegram/StickerFormat.cpp td/telegram/StickerMaskPosition.cpp td/telegram/StickerPhotoSize.cpp @@ -777,6 +778,7 @@ set(TDLIB_SOURCE td/telegram/SpecialStickerSetType.h td/telegram/SponsoredMessageManager.h td/telegram/StateManager.h + td/telegram/StatisticsManager.h td/telegram/StickerFormat.h td/telegram/StickerMaskPosition.h td/telegram/StickerPhotoSize.h diff --git a/SplitSource.php b/SplitSource.php index 7bb4df74a..9a4522d5a 100644 --- a/SplitSource.php +++ b/SplitSource.php @@ -313,6 +313,7 @@ function split_file($file, $chunks, $undo) { 'SecretChatActor' => 'SecretChatActor', 'secret_chats_manager[_(-]|SecretChatsManager' => 'SecretChatsManager', 'sponsored_message_manager[_(-][^.]|SponsoredMessageManager' => 'SponsoredMessageManager', + 'statistics_manager[_(-][^.]|StatisticsManager' => 'StatisticsManager', 'stickers_manager[_(-][^.]|StickersManager' => 'StickersManager', 'story_manager[_(-][^.]|StoryManager' => 'StoryManager', '[>](td_db[(][)]|get_td_db_impl[(])|TdDb[^A-Za-z]' => 'TdDb', diff --git a/td/telegram/StatisticsManager.cpp b/td/telegram/StatisticsManager.cpp new file mode 100644 index 000000000..946826484 --- /dev/null +++ b/td/telegram/StatisticsManager.cpp @@ -0,0 +1,18 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// +// 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) +// +#include "td/telegram/StatisticsManager.h" + +namespace td { + +StatisticsManager::StatisticsManager(Td *td, ActorShared<> parent) : td_(td), parent_(std::move(parent)) { +} + +void StatisticsManager::tear_down() { + parent_.reset(); +} + +} // namespace td diff --git a/td/telegram/StatisticsManager.h b/td/telegram/StatisticsManager.h new file mode 100644 index 000000000..ad34d1cc9 --- /dev/null +++ b/td/telegram/StatisticsManager.h @@ -0,0 +1,28 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// +// 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/actor/actor.h" + +#include "td/utils/common.h" + +namespace td { + +class Td; + +class StatisticsManager final : public Actor { + public: + StatisticsManager(Td *td, ActorShared<> parent); + + private: + void tear_down() final; + + Td *td_; + ActorShared<> parent_; +}; + +} // namespace td diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index f3599e13a..2f250d452 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -121,6 +121,7 @@ #include "td/telegram/SentEmailCode.h" #include "td/telegram/SponsoredMessageManager.h" #include "td/telegram/StateManager.h" +#include "td/telegram/StatisticsManager.h" #include "td/telegram/StickerFormat.h" #include "td/telegram/StickerSetId.h" #include "td/telegram/StickersManager.h" @@ -3312,6 +3313,8 @@ void Td::dec_actor_refcnt() { LOG(DEBUG) << "ReactionManager was cleared" << timer; sponsored_message_manager_.reset(); LOG(DEBUG) << "SponsoredMessageManager was cleared" << timer; + statistics_manager_.reset(); + LOG(DEBUG) << "StatisticsManager was cleared" << timer; stickers_manager_.reset(); LOG(DEBUG) << "StickersManager was cleared" << timer; story_manager_.reset(); @@ -3518,6 +3521,8 @@ void Td::clear() { LOG(DEBUG) << "ReactionManager actor was cleared" << timer; sponsored_message_manager_actor_.reset(); LOG(DEBUG) << "SponsoredMessageManager actor was cleared" << timer; + statistics_manager_actor_.reset(); + LOG(DEBUG) << "StatisticsManager actor was cleared" << timer; stickers_manager_actor_.reset(); LOG(DEBUG) << "StickersManager actor was cleared" << timer; story_manager_actor_.reset(); @@ -4008,6 +4013,8 @@ void Td::init_managers() { sponsored_message_manager_ = make_unique(this, create_reference()); sponsored_message_manager_actor_ = register_actor("SponsoredMessageManager", sponsored_message_manager_.get()); G()->set_sponsored_message_manager(sponsored_message_manager_actor_.get()); + statistics_manager_ = make_unique(this, create_reference()); + statistics_manager_actor_ = register_actor("StatisticsManager", statistics_manager_.get()); stickers_manager_ = make_unique(this, create_reference()); stickers_manager_actor_ = register_actor("StickersManager", stickers_manager_.get()); G()->set_stickers_manager(stickers_manager_actor_.get()); diff --git a/td/telegram/Td.h b/td/telegram/Td.h index fbf7aa57b..f19a81421 100644 --- a/td/telegram/Td.h +++ b/td/telegram/Td.h @@ -77,6 +77,7 @@ class SecureManager; class SecretChatsManager; class SponsoredMessageManager; class StateManager; +class StatisticsManager; class StickersManager; class StorageManager; class StoryManager; @@ -199,6 +200,8 @@ class Td final : public Actor { ActorOwn reaction_manager_actor_; unique_ptr sponsored_message_manager_; ActorOwn sponsored_message_manager_actor_; + unique_ptr statistics_manager_; + ActorOwn statistics_manager_actor_; unique_ptr stickers_manager_; ActorOwn stickers_manager_actor_; unique_ptr story_manager_;