ReactivePlusPlus
ReactiveX implementation for C++20
|
Combining operators are operators that combines emissions of multiple observables into same observable by some rule. More...
Functions | |
template<typename TSelector, rpp::constraint::observable TObservable, rpp::constraint::observable... TObservables> requires (!rpp::constraint::observable<TSelector> && (!utils::is_not_template_callable<TSelector> || std::invocable<TSelector, rpp::utils::convertible_to_any, utils::extract_observable_type_t<TObservable>, utils::extract_observable_type_t<TObservables>...>)) | |
auto | rpp::operators::combine_latest (TSelector &&selector, TObservable &&observable, TObservables &&... observables) |
Combines latest emissions from observables with emission from current observable when any observable sends new value via applying selector. | |
template<rpp::constraint::observable TObservable, rpp::constraint::observable... TObservables> | |
auto | rpp::operators::combine_latest (TObservable &&observable, TObservables &&... observables) |
Combines latest emissions from observables with emission from current observable when any observable sends new value via making tuple. | |
auto | rpp::operators::merge () |
Converts observable of observables of items into observable of items via merging emissions. | |
template<rpp::constraint::observable TObservable, rpp::constraint::observable... TObservables> requires constraint::observables_of_same_type<std::decay_t<TObservable>, std::decay_t<TObservables>...> | |
auto | rpp::operators::merge_with (TObservable &&observable, TObservables &&... observables) |
Combines submissions from current observable with other observables into one. | |
template<rpp::constraint::observable TObservable, rpp::constraint::observable... TObservables> requires constraint::observables_of_same_type<std::decay_t<TObservable>, std::decay_t<TObservables>...> | |
auto | rpp::operators::start_with (TObservable &&observable, TObservables &&... observables) |
Combines submissions from current observable with other observables into one but without overlapping and starting from observables provided as arguments. | |
template<constraint::memory_model MemoryModel = memory_model::use_stack, typename T, typename... Ts> requires (rpp::constraint::decayed_same_as<T, Ts> && ...) | |
auto | rpp::operators::start_with_values (T &&v, Ts &&... vals) |
Combines submissions from current observable with values into one but without overlapping and starting from values provided as arguments. | |
template<constraint::memory_model MemoryModel = memory_model::use_stack, rpp::schedulers::constraint::scheduler TScheduler, typename T, typename... Ts> requires (rpp::constraint::decayed_same_as<T, Ts> && ...) | |
auto | rpp::operators::start_with_values (const TScheduler &scheduler, T &&v, Ts &&... vals) |
Combines submissions from current observable with values into one but without overlapping and starting from values provided as arguments. | |
auto | rpp::operators::switch_on_next () |
Converts observable of observables into observable of values which emits values from most recent underlying observable till new observable obtained. | |
template<typename TSelector, rpp::constraint::observable TObservable, rpp::constraint::observable... TObservables> requires (!rpp::constraint::observable<TSelector> && (!utils::is_not_template_callable<TSelector> || std::invocable<TSelector, rpp::utils::convertible_to_any, utils::extract_observable_type_t<TObservable>, utils::extract_observable_type_t<TObservables>...>)) | |
auto | rpp::operators::with_latest_from (TSelector &&selector, TObservable &&observable, TObservables &&... observables) |
Combines latest emissions from observables with emission from current observable when it sends new value via applying selector. | |
template<rpp::constraint::observable TObservable, rpp::constraint::observable... TObservables> | |
auto | rpp::operators::with_latest_from (TObservable &&observable, TObservables &&... observables) |
Combines latest emissions from observables with emission from current observable when it sends new value via making tuple. | |
template<typename TSelector, rpp::constraint::observable TObservable, rpp::constraint::observable... TObservables> requires (!rpp::constraint::observable<TSelector> && (!utils::is_not_template_callable<TSelector> || std::invocable<TSelector, rpp::utils::convertible_to_any, utils::extract_observable_type_t<TObservable>, utils::extract_observable_type_t<TObservables>...>)) | |
auto | rpp::operators::zip (TSelector &&selector, TObservable &&observable, TObservables &&... observables) |
combines emissions from observables and emit single items for each combination based on the results of provided selector | |
template<rpp::constraint::observable TObservable, rpp::constraint::observable... TObservables> | |
auto | rpp::operators::zip (TObservable &&observable, TObservables &&... observables) |
combines emissions from observables and emit tuple of items for each combination | |
Combining operators are operators that combines emissions of multiple observables into same observable by some rule.
auto rpp::operators::combine_latest | ( | TObservable && | observable, |
TObservables &&... | observables ) |
Combines latest emissions from observables with emission from current observable when any observable sends new value via making tuple.
Actually this operator subscribes on all of theses observables and emits new combined value when any of them emits new emission (and each observable emit values at least one to be able to provide combined value)
observables | are observables whose emissions would be combined when any observable sends new value |
#include <rpp/operators/combine_latest.hpp>
auto rpp::operators::combine_latest | ( | TSelector && | selector, |
TObservable && | observable, | ||
TObservables &&... | observables ) |
Combines latest emissions from observables with emission from current observable when any observable sends new value via applying selector.
Actually this operator subscribes on all of theses observables and emits new combined value when any of them emits new emission (and each observable emit values at least one to be able to provide combined value)
selector | is applied to current emission of current observable and latests emissions from observables |
observables | are observables whose emissions would be combined with current observable |
#include <rpp/operators/combine_latest.hpp>
|
inline |
Converts observable of observables of items into observable of items via merging emissions.
Actually it subscribes on each observable from emissions. Resulting observables completes when ALL observables completes
#include <rpp/operators/merge.hpp>
auto rpp::operators::merge_with | ( | TObservable && | observable, |
TObservables &&... | observables ) |
Combines submissions from current observable with other observables into one.
Actually it subscribes on each observable. Resulting observables completes when ALL observables completes
observables | are observables whose emissions would be merged with current observable |
#include <rpp/operators/merge.hpp>
auto rpp::operators::start_with | ( | TObservable && | observable, |
TObservables &&... | observables ) |
Combines submissions from current observable with other observables into one but without overlapping and starting from observables provided as arguments.
start_with_values
insteadActually it makes concat(observables_to_start_with..., current_observable) so observables from argument subscribed before current observable
observables | list of observables which should be used before current observable |
#include <rpp/operators/start_with.hpp>
auto rpp::operators::start_with_values | ( | const TScheduler & | scheduler, |
T && | v, | ||
Ts &&... | vals ) |
Combines submissions from current observable with values into one but without overlapping and starting from values provided as arguments.
Actually it makes concat(rpp::source::just(vals_to_start_with)..., current_observable) so observables from argument subscribed before current observable
memory_model | memory_model strategy used to store provided values |
vals | list of values which should be emitted before current observable |
#include <rpp/operators/start_with.hpp>
auto rpp::operators::start_with_values | ( | T && | v, |
Ts &&... | vals ) |
Combines submissions from current observable with values into one but without overlapping and starting from values provided as arguments.
Actually it makes concat(rpp::source::just(vals_to_start_with)..., current_observable) so observables from argument subscribed before current observable
This overloading operates on rpp::schedulers::current_thread by default
memory_model | memory_model strategy used to store provided values |
vals | list of values which should be emitted before current observable |
#include <rpp/operators/start_with.hpp>
|
inline |
Converts observable of observables into observable of values which emits values from most recent underlying observable till new observable obtained.
Actually this operator just unsubscribes from previous observable and subscribes on new observable when obtained in on_next
#include <rpp/operators/switch_on_next.hpp>
auto rpp::operators::with_latest_from | ( | TObservable && | observable, |
TObservables &&... | observables ) |
Combines latest emissions from observables with emission from current observable when it sends new value via making tuple.
observables | are observables whose emissions would be combined when current observable sends new value |
#include <rpp/operators/with_latest_from.hpp>
auto rpp::operators::with_latest_from | ( | TSelector && | selector, |
TObservable && | observable, | ||
TObservables &&... | observables ) |
Combines latest emissions from observables with emission from current observable when it sends new value via applying selector.
Actually this operator just keeps last values from all other observables and combines them together with each new emission from original observable
selector | is applied to current emission of current observable and latests emissions from observables |
observables | are observables whose emissions would be combined when current observable sends new value |
#include <rpp/operators/with_latest_from.hpp>
auto rpp::operators::zip | ( | TObservable && | observable, |
TObservables &&... | observables ) |
combines emissions from observables and emit tuple of items for each combination
observables | are observables whose emissions would be zipped with current observable |
#include <rpp/operators/zip.hpp>
auto rpp::operators::zip | ( | TSelector && | selector, |
TObservable && | observable, | ||
TObservables &&... | observables ) |
combines emissions from observables and emit single items for each combination based on the results of provided selector
selector | is applied to current emission of current observable and latests emissions from observables |
observables | are observables whose emissions would be zipped with current observable |
#include <rpp/operators/zip.hpp>