13#include <rpp/observables/details/member_overload.hpp>
14#include <rpp/subscribers/constraints.hpp>
15#include <rpp/utils/function_traits.hpp>
16#include <rpp/utils/functors.hpp>
25template<
typename T,
typename NewType>
28template<constra
int::decayed_type Type, constra
int::decayed_type OnNext, constra
int::decayed_type OnError, constra
int::decayed_type OnCompleted>
29struct lift_action_by_callbacks;
31template<
typename... Types>
32using decayed_lift_action_by_callbacks = lift_action_by_callbacks<std::decay_t<Types>...>;
34template<constra
int::decayed_type NewType, lift_fn<NewType> OperatorFn,
typename TObs>
35auto lift_impl(OperatorFn&& op, TObs&& _this);
37template<constra
int::decayed_type Type,
typename SpecificObservable>
46 template<constra
int::decayed_type NewType>
49 return details::lift_impl<NewType>(std::forward<
decltype(op)>(op), CastThis());
52 template<constra
int::decayed_type NewType>
53 auto lift(
lift_fn<NewType> auto&& op)&&
requires is_header_included<lift_tag, NewType>
55 return details::lift_impl<NewType>(std::forward<
decltype(op)>(op), MoveThis());
66 template<
typename OperatorFn,
67 constraint::decayed_type NewType = utils::extract_subscriber_type_t<utils::function_argument_t<OperatorFn>>>
70 return details::lift_impl<NewType>(std::forward<
decltype(op)>(op), CastThis());
72 template<
typename OperatorFn,
73 constraint::decayed_type NewType = utils::extract_subscriber_type_t<utils::function_argument_t<OperatorFn>>>
76 return details::lift_impl<NewType>(std::forward<
decltype(op)>(op), MoveThis());
90 template<constraint::decayed_type NewType,
91 std::invocable<Type, dynamic_subscriber<NewType>> OnNext,
92 std::invocable<std::exception_ptr, dynamic_subscriber<NewType>> OnError = utils::forwarding_on_error,
93 std::invocable<dynamic_subscriber<NewType>> OnCompleted = utils::forwarding_on_completed>
94 auto lift(OnNext&& on_next, OnError&& on_error = {}, OnCompleted&& on_completed = {})
const&
requires is_header_included<lift_tag, NewType, OnNext, OnError, OnCompleted>
97 std::forward<OnError>(on_error),
98 std::forward<OnCompleted>(on_completed)},
102 template<constraint::decayed_type NewType,
103 std::invocable<Type, dynamic_subscriber<NewType>> OnNext,
104 std::invocable<std::exception_ptr, dynamic_subscriber<NewType>> OnError = utils::forwarding_on_error,
105 std::invocable<dynamic_subscriber<NewType>> OnCompleted = utils::forwarding_on_completed>
106 auto lift(OnNext&& on_next, OnError&& on_error = {}, OnCompleted&& on_completed = {})&&
requires is_header_included<lift_tag, NewType, OnNext, OnError, OnCompleted>
108 return details::lift_impl<NewType>(details::decayed_lift_action_by_callbacks<Type, OnNext, OnError, OnCompleted>{std::forward<OnNext>(on_next),
109 std::forward<OnError>(on_error),
110 std::forward<OnCompleted>(on_completed)},
124 template<
typename OnNext,
125 constraint::decayed_type NewType = utils::extract_subscriber_type_t<std::decay_t<utils::function_argument_t<OnNext, 1>>>,
126 std::invocable<std::exception_ptr, dynamic_subscriber<NewType>> OnError = utils::forwarding_on_error,
127 std::invocable<dynamic_subscriber<NewType>> OnCompleted = utils::forwarding_on_completed>
128 requires std::invocable<OnNext, Type, dynamic_subscriber<NewType>>
129 auto lift(OnNext&& on_next, OnError&& on_error = {}, OnCompleted&& on_completed = {})
const&
requires is_header_included<lift_tag, NewType, OnNext, OnError, OnCompleted>
132 std::forward<OnError>(on_error),
133 std::forward<OnCompleted>(on_completed)},
137 template<
typename OnNext,
138 constraint::decayed_type NewType = utils::extract_subscriber_type_t<std::decay_t<utils::function_argument_t<OnNext, 1>>>,
139 std::invocable<std::exception_ptr, dynamic_subscriber<NewType>> OnError = utils::forwarding_on_error,
140 std::invocable<dynamic_subscriber<NewType>> OnCompleted = utils::forwarding_on_completed>
141 requires std::invocable<OnNext, Type, dynamic_subscriber<NewType>>
142 auto lift(OnNext&& on_next, OnError&& on_error = {}, OnCompleted&& on_completed = {})&&
requires is_header_included<lift_tag, NewType, OnNext, OnError, OnCompleted>
144 return details::lift_impl<NewType>(details::decayed_lift_action_by_callbacks<Type, OnNext, OnError, OnCompleted>{std::forward<OnNext>(on_next),
145 std::forward<OnError>(on_error),
146 std::forward<OnCompleted>(on_completed)},
151 const SpecificObservable& CastThis()
const
153 return *
static_cast<const SpecificObservable*
>(
this);
156 SpecificObservable&& MoveThis()
158 return std::move(*
static_cast<SpecificObservable*
>(
this));
Definition: constraints.hpp:19
auto lift(lift_fn< NewType > auto &&op) const &
The lift operator provides ability to create your own operator and apply it to observable.
Definition: lift.hpp:47
auto lift(OnNext &&on_next, OnError &&on_error={}, OnCompleted &&on_completed={}) const &is_header_included< lift_tag
The lift operator provides ability to create your own operator and apply it to observable.
auto lift(OnNext &&on_next, OnError &&on_error={}, OnCompleted &&on_completed={}) const &
The lift operator provides ability to create your own operator and apply it to observable.
Definition: lift.hpp:94
auto lift(OperatorFn &&op) const &
The lift operator provides ability to create your own operator and apply it to observable.
Definition: lift.hpp:68
Definition: member_overload.hpp:19