diff options
| author | levlam <levlam@telegram.org> | 2022-10-01 16:29:56 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2022-10-01 16:29:56 +0300 |
| commit | d4d365d31fb4acfeae27d089b403b5e60b1c3680 (patch) | |
| tree | 4caf0be42066fb1842a3a5983561e48cb16abdc6 | |
| parent | be87e4179f9ce80fe4352eec0a0a9937d420284a (diff) | |
Remove template ActorOwn::reset.
| -rw-r--r-- | td/telegram/net/ConnectionCreator.h | 5 | ||||
| -rw-r--r-- | tdactor/td/actor/impl/ActorId-decl.h | 2 | ||||
| -rw-r--r-- | tdactor/td/actor/impl/ActorId.h | 8 |
3 files changed, 4 insertions, 11 deletions
diff --git a/td/telegram/net/ConnectionCreator.h b/td/telegram/net/ConnectionCreator.h index 92c7a5eee..49091245b 100644 --- a/td/telegram/net/ConnectionCreator.h +++ b/td/telegram/net/ConnectionCreator.h @@ -172,9 +172,8 @@ class ConnectionCreator final : public NetQueryCallback { std::shared_ptr<NetStatsCallback> media_net_stats_callback_; std::shared_ptr<NetStatsCallback> common_net_stats_callback_; - ActorShared<> ref_cnt_guard_; + ActorShared<ConnectionCreator> ref_cnt_guard_; int ref_cnt_{0}; - ActorShared<ConnectionCreator> create_reference(int64 token); bool close_flag_{false}; uint64 current_token_ = 0; std::map<uint64, std::pair<bool, ActorShared<>>> children_; @@ -190,6 +189,8 @@ class ConnectionCreator final : public NetQueryCallback { return ++current_token_; } + ActorShared<ConnectionCreator> create_reference(int64 token); + void set_active_proxy_id(int32 proxy_id, bool from_binlog = false); void enable_proxy_impl(int32 proxy_id); void disable_proxy_impl(); diff --git a/tdactor/td/actor/impl/ActorId-decl.h b/tdactor/td/actor/impl/ActorId-decl.h index 9fc7f6b98..220abcdb3 100644 --- a/tdactor/td/actor/impl/ActorId-decl.h +++ b/tdactor/td/actor/impl/ActorId-decl.h @@ -123,8 +123,6 @@ class ActorShared { ActorId<ActorType> get() const; ActorId<ActorType> release(); void reset(ActorId<ActorType> other = ActorId<ActorType>()); - template <class OtherActorType> - void reset(ActorId<OtherActorType> other); private: ActorId<ActorType> id_; diff --git a/tdactor/td/actor/impl/ActorId.h b/tdactor/td/actor/impl/ActorId.h index 30cbbfb91..389833e19 100644 --- a/tdactor/td/actor/impl/ActorId.h +++ b/tdactor/td/actor/impl/ActorId.h @@ -160,17 +160,11 @@ ActorId<ActorType> ActorShared<ActorType>::release() { template <class ActorType> void ActorShared<ActorType>::reset(ActorId<ActorType> other) { - reset<ActorType>(std::move(other)); -} - -template <class ActorType> -template <class OtherActorType> -void ActorShared<ActorType>::reset(ActorId<OtherActorType> other) { static_assert(sizeof(ActorType) > 0, "Can't use ActorShared with incomplete type"); if (!id_.empty()) { send_event(*this, Event::hangup()); } - id_ = static_cast<ActorId<ActorType>>(other); + id_ = std::move(other); } template <class T> |
