Remove template ActorOwn::reset.

This commit is contained in:
levlam 2022-10-01 16:29:56 +03:00
parent be87e4179f
commit d4d365d31f
3 changed files with 4 additions and 11 deletions

View File

@ -172,9 +172,8 @@ class ConnectionCreator final : public NetQueryCallback {
std::shared_ptr<NetStatsCallback> media_net_stats_callback_; std::shared_ptr<NetStatsCallback> media_net_stats_callback_;
std::shared_ptr<NetStatsCallback> common_net_stats_callback_; std::shared_ptr<NetStatsCallback> common_net_stats_callback_;
ActorShared<> ref_cnt_guard_; ActorShared<ConnectionCreator> ref_cnt_guard_;
int ref_cnt_{0}; int ref_cnt_{0};
ActorShared<ConnectionCreator> create_reference(int64 token);
bool close_flag_{false}; bool close_flag_{false};
uint64 current_token_ = 0; uint64 current_token_ = 0;
std::map<uint64, std::pair<bool, ActorShared<>>> children_; std::map<uint64, std::pair<bool, ActorShared<>>> children_;
@ -190,6 +189,8 @@ class ConnectionCreator final : public NetQueryCallback {
return ++current_token_; return ++current_token_;
} }
ActorShared<ConnectionCreator> create_reference(int64 token);
void set_active_proxy_id(int32 proxy_id, bool from_binlog = false); void set_active_proxy_id(int32 proxy_id, bool from_binlog = false);
void enable_proxy_impl(int32 proxy_id); void enable_proxy_impl(int32 proxy_id);
void disable_proxy_impl(); void disable_proxy_impl();

View File

@ -123,8 +123,6 @@ class ActorShared {
ActorId<ActorType> get() const; ActorId<ActorType> get() const;
ActorId<ActorType> release(); ActorId<ActorType> release();
void reset(ActorId<ActorType> other = ActorId<ActorType>()); void reset(ActorId<ActorType> other = ActorId<ActorType>());
template <class OtherActorType>
void reset(ActorId<OtherActorType> other);
private: private:
ActorId<ActorType> id_; ActorId<ActorType> id_;

View File

@ -160,17 +160,11 @@ ActorId<ActorType> ActorShared<ActorType>::release() {
template <class ActorType> template <class ActorType>
void ActorShared<ActorType>::reset(ActorId<ActorType> other) { 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"); static_assert(sizeof(ActorType) > 0, "Can't use ActorShared with incomplete type");
if (!id_.empty()) { if (!id_.empty()) {
send_event(*this, Event::hangup()); send_event(*this, Event::hangup());
} }
id_ = static_cast<ActorId<ActorType>>(other); id_ = std::move(other);
} }
template <class T> template <class T>