27 struct observer_strategy
29 static constexpr auto preferred_disposables_mode = rpp::details::observers::disposables_mode::None;
31 std::shared_ptr<subjects::details::subject_state<Type, false>> state{};
35 bool is_disposed()
const noexcept {
return state->is_disposed(); }
37 void on_next(
const Type& v)
const { state->on_next(v); }
39 void on_error(
const std::exception_ptr& err)
const { state->on_error(err); }
41 void on_completed()
const { state->on_completed(); }
48 : m_refcount{std::move(refcount)}
52 auto get_observer()
const
57 auto get_observable()
const
60 if (const auto locked_state = state.lock())
62 if (const auto locked = refcount.lock())
63 observer.set_upstream(locked->add_ref());
64 locked_state->on_subscribe(std::forward<TObs>(observer));
71 return m_state.as_weak();