3#include <rpp/observables/details/member_overload.hpp>
4#include <rpp/subscribers/constraints.hpp>
5#include <rpp/subscribers/specific_subscriber.hpp>
6#include <rpp/subscriptions/composite_subscription.hpp>
14template<constra
int::decayed_type Type,
typename SpecificObservable>
22 template<constra
int::subscriber_of_type<Type> TSub>
25 return subscribe_impl(std::forward<TSub>(subscriber));
33 template<constra
int::observer_of_type<Type> TObserver>
36 return subscribe_impl<std::decay_t<TObserver>>(std::forward<TObserver>(observer));
44 template<constra
int::observer_of_type<Type> TObserver>
47 return subscribe_impl(
specific_subscriber<Type, std::decay_t<TObserver>>{std::move(sub), std::forward<TObserver>(observer)});
55 template<constra
int::on_next_fn<Type> TOnNext = utils::empty_function_t<Type>,
56 constra
int::on_error_fn TOnError = utils::rethrow_error_t,
57 constra
int::on_completed_fn TOnCompleted = utils::empty_function_t<>>
58 auto subscribe(TOnNext&& on_next = {}, TOnError&& on_error = {}, TOnCompleted&& on_completed = {})
const
60 return subscribe_impl(make_specific_subscriber<Type>(std::forward<TOnNext>(on_next), std::forward<TOnError>(on_error), std::forward<TOnCompleted>(on_completed)));
68 template<constra
int::on_next_fn<Type> TOnNext, constra
int::on_completed_fn TOnCompleted>
69 auto subscribe(TOnNext&& on_next, TOnCompleted&& on_completed)
const
71 return subscribe_impl(make_specific_subscriber<Type>(std::forward<TOnNext>(on_next), std::forward<TOnCompleted>(on_completed)));
79 template<constra
int::on_next_fn<Type> TOnNext = utils::empty_function_t<Type>,
80 constra
int::on_error_fn TOnError = utils::rethrow_error_t,
81 constra
int::on_completed_fn TOnCompleted = utils::empty_function_t<>>
84 return subscribe_impl(make_specific_subscriber<Type>(std::move(sub), std::forward<TOnNext>(on_next), std::forward<TOnError>(on_error), std::forward<TOnCompleted>(on_completed)));
92 template<constra
int::on_next_fn<Type> TOnNext,
93 constra
int::on_completed_fn TOnCompleted>
96 return subscribe_impl(make_specific_subscriber<Type>(std::move(sub), std::forward<TOnNext>(on_next), std::forward<TOnCompleted>(on_completed)));
100 template<constra
int::observer_of_type<Type> Obs>
103 return static_cast<const SpecificObservable*
>(
this)->subscribe_impl(subscriber);
rpp::subscription_base with ability to add some dependent subscriptions as a part of this one: in cas...
Definition: composite_subscription.hpp:30
specific version of subscriber which stores type of observer used inside to prevent extra allocations
Definition: specific_subscriber.hpp:31
auto subscribe(TOnNext &&on_next={}, TOnError &&on_error={}, TOnCompleted &&on_completed={}) const
Main function of observable. Initiates subscription for provided subscriber and calls stored OnSubscr...
Definition: subscribe.hpp:58
auto subscribe(TSub &&subscriber) const
Main function of observable. Initiates subscription for provided subscriber and calls stored OnSubscr...
Definition: subscribe.hpp:23
auto subscribe(composite_subscription sub, TOnNext &&on_next, TOnCompleted &&on_completed) const
Main function of observable. Initiates subscription for provided subscriber and calls stored OnSubscr...
Definition: subscribe.hpp:94
auto subscribe(composite_subscription sub, TOnNext &&on_next={}, TOnError &&on_error={}, TOnCompleted &&on_completed={}) const
Main function of observable. Initiates subscription for provided subscriber and calls stored OnSubscr...
Definition: subscribe.hpp:82
auto subscribe(TOnNext &&on_next, TOnCompleted &&on_completed) const
Main function of observable. Initiates subscription for provided subscriber and calls stored OnSubscr...
Definition: subscribe.hpp:69
auto subscribe(TObserver &&observer) const
Main function of observable. Initiates subscription for provided subscriber and calls stored OnSubscr...
Definition: subscribe.hpp:34
auto subscribe(composite_subscription sub, TObserver &&observer) const
Main function of observable. Initiates subscription for provided subscriber and calls stored OnSubscr...
Definition: subscribe.hpp:45
Definition: member_overload.hpp:19