12#include <rpp/subjects/fwd.hpp>
14#include <rpp/disposables/disposable_wrapper.hpp>
15#include <rpp/observers/observer.hpp>
16#include <rpp/subjects/details/subject_on_subscribe.hpp>
17#include <rpp/subjects/details/subject_state.hpp>
19namespace rpp::subjects::details
21 template<rpp::constra
int::decayed_type Type,
bool Serialized>
24 struct observer_strategy
26 static constexpr auto preferred_disposables_mode = rpp::details::observers::disposables_mode::None;
28 std::shared_ptr<details::subject_state<Type, Serialized>> state{};
32 bool is_disposed()
const noexcept {
return state->is_disposed(); }
34 void on_next(
const Type& v)
const { state->on_next(v); }
36 void on_error(
const std::exception_ptr& err)
const { state->on_error(err); }
38 void on_completed()
const { state->on_completed(); }
46 auto get_observer()
const
51 auto get_observable()
const
65namespace rpp::subjects
79 template<rpp::constra
int::decayed_type Type>
93 template<rpp::constra
int::decayed_type Type>
Base class for any observer used in RPP. It handles core callbacks of observers. Objects of this clas...
Definition observer.hpp:172
Definition publish_subject.hpp:23
Subject which just multicasts values to observers subscribed on it. It contains two parts: observer a...
Definition publish_subject.hpp:81
Serialized version of rpp::subjects::publish_subject.
Definition publish_subject.hpp:95
Definition disposables_strategy.hpp:29