30 class dynamic_strategy final
33 using value_type = Type;
34 using optimal_disposables_strategy = rpp::details::observables::default_disposables_strategy;
36 template<rpp::constra
int::observable_strategy<Type> Strategy>
39 : m_forwarder{std::make_shared<observable<Type, Strategy>>(std::move(obs))}
40 , m_vtable{vtable::template create<observable<Type, Strategy>>()}
44 template<rpp::constra
int::observable_strategy<Type> Strategy>
47 : m_forwarder{std::make_shared<observable<Type, Strategy>>(obs)}
48 , m_vtable{vtable::template create<observable<Type, Strategy>>()}
52 template<rpp::constra
int::observer_strategy<Type> ObserverStrategy>
55 m_vtable->subscribe(m_forwarder.get(), std::move(
observer).as_dynamic());
63 template<rpp::constra
int::observable Observable>
64 static const vtable* create()
noexcept
66 static vtable s_res{.subscribe = forwarding_subscribe<Type, Observable>};
72 std::shared_ptr<void> m_forwarder;
73 const vtable* m_vtable;
auto subscribe(observer< Type, ObserverStrategy > &&observer)
Subscribes passed observer to emissions from this observable.
Definition subscribe.hpp:226