RxCpp
The Reactive Extensions for Native (RxCpp) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators in both C and C++.
|
Classes | |
struct | is_operator |
struct | operator_base |
struct | tag_operator |
Functions | |
template<class... AN> | |
auto | all (AN &&...an) -> operator_factory< all_tag, AN... > |
Returns an Observable that emits true if every item emitted by the source Observable satisfies a specified condition, otherwise false. Emits true if the source Observable terminates without emitting any item. More... | |
template<class... AN> | |
auto | is_empty (AN &&...an) -> operator_factory< is_empty_tag, AN... > |
Returns an Observable that emits true if the source Observable is empty, otherwise false. More... | |
template<class... AN> | |
auto | amb (AN &&...an) -> operator_factory< amb_tag, AN... > |
For each item from only the first of the given observables deliver from the new observable that is returned, on the specified scheduler. More... | |
template<class... AN> | |
auto | any (AN &&...an) -> operator_factory< any_tag, AN... > |
Returns an Observable that emits true if any item emitted by the source Observable satisfies a specified condition, otherwise false. Emits false if the source Observable terminates without emitting any item. More... | |
template<class... AN> | |
auto | exists (AN &&...an) -> operator_factory< exists_tag, AN... > |
Returns an Observable that emits true if any item emitted by the source Observable satisfies a specified condition, otherwise false. Emits false if the source Observable terminates without emitting any item. More... | |
template<class... AN> | |
auto | contains (AN &&...an) -> operator_factory< contains_tag, AN... > |
Returns an Observable that emits true if the source Observable emitted a specified item, otherwise false. Emits false if the source Observable terminates without emitting any item. More... | |
template<class... AN> | |
auto | buffer (AN &&...an) -> operator_factory< buffer_count_tag, AN... > |
Return an observable that emits connected, non-overlapping buffer, each containing at most count items from the source observable. If the skip parameter is set, return an observable that emits buffers every skip items containing at most count items from the source observable. More... | |
template<class... AN> | |
auto | buffer_with_time (AN &&...an) -> operator_factory< buffer_with_time_tag, AN... > |
Return an observable that emits buffers every period time interval and collects items from this observable for period of time into each produced buffer. If the skip parameter is set, Return an observable that emits buffers every skip time interval and collects items from this observable for period of time into each produced buffer, on the specified scheduler. More... | |
template<class... AN> | |
auto | buffer_with_time_or_count (AN &&...an) -> operator_factory< buffer_with_time_or_count_tag, AN... > |
Return an observable that emits connected, non-overlapping buffers of items from the source observable that were emitted during a fixed duration of time or when the buffer has reached maximum capacity (whichever occurs first), on the specified scheduler. More... | |
template<class... AN> | |
auto | combine_latest (AN &&...an) -> operator_factory< combine_latest_tag, AN... > |
For each item from all of the observables select a value to emit from the new observable that is returned. More... | |
template<class... AN> | |
auto | concat (AN &&...an) -> operator_factory< concat_tag, AN... > |
For each item from this observable subscribe to one at a time, in the order received. For each item from all of the given observables deliver from the new observable that is returned. More... | |
template<class... AN> | |
auto | concat_map (AN &&...an) -> operator_factory< concat_map_tag, AN... > |
For each item from this observable use the CollectionSelector to produce an observable and subscribe to that observable. For each item from all of the produced observables use the ResultSelector to produce a value to emit from the new observable that is returned. More... | |
template<class... AN> | |
auto | concat_transform (AN &&...an) -> operator_factory< concat_map_tag, AN... > |
For each item from this observable use the CollectionSelector to produce an observable and subscribe to that observable. For each item from all of the produced observables use the ResultSelector to produce a value to emit from the new observable that is returned. More... | |
template<class... AN> | |
auto | connect_forever (AN &&...an) -> operator_factory< connect_forever_tag, AN... > |
takes a connectable_observable source and calls connect during the construction of the expression. This means that the source starts running without any subscribers and continues running after all subscriptions have been unsubscribed. More... | |
template<class... AN> | |
auto | debounce (AN &&...an) -> operator_factory< debounce_tag, AN... > |
Return an observable that emits an item if a particular timespan has passed without emitting another item from the source observable. More... | |
template<class... AN> | |
auto | delay (AN &&...an) -> operator_factory< delay_tag, AN... > |
Return an observable that emits each item emitted by the source observable after the specified delay. More... | |
template<class... AN> | |
auto | distinct (AN &&...an) -> operator_factory< distinct_tag, AN... > |
For each item from this observable, filter out repeated values and emit only items that have not already been emitted. More... | |
template<class... AN> | |
auto | distinct_until_changed (AN &&...an) -> operator_factory< distinct_until_changed_tag, AN... > |
For each item from this observable, filter out consequentially repeated values and emit only changes from the new observable that is returned. More... | |
template<class... AN> | |
auto | element_at (AN &&...an) -> operator_factory< element_at_tag, AN... > |
Pulls an item located at a specified index location in the sequence of items and emits that item as its own sole emission. More... | |
template<class... AN> | |
auto | filter (AN &&...an) -> operator_factory< filter_tag, AN... > |
For each item from this observable use Predicate to select which items to emit from the new observable that is returned. More... | |
template<class... AN> | |
auto | finally (AN &&...an) -> operator_factory< final ly_tag |
Add a new action at the end of the new observable that is returned. More... | |
template<class... AN> | |
auto | flat_map (AN &&...an) -> operator_factory< flat_map_tag, AN... > |
For each item from this observable use the CollectionSelector to produce an observable and subscribe to that observable. For each item from all of the produced observables use the ResultSelector to produce a value to emit from the new observable that is returned. More... | |
template<class... AN> | |
auto | merge_transform (AN &&...an) -> operator_factory< flat_map_tag, AN... > |
For each item from this observable use the CollectionSelector to produce an observable and subscribe to that observable. For each item from all of the produced observables use the ResultSelector to produce a value to emit from the new observable that is returned. More... | |
template<class... AN> | |
auto | group_by (AN &&...an) -> operator_factory< group_by_tag, AN... > |
Return an observable that emits grouped_observables, each of which corresponds to a unique key value and each of which emits those items from the source observable that share that key value. More... | |
template<class... AN> | |
auto | ignore_elements (AN &&...an) -> operator_factory< ignore_elements_tag, AN... > |
Do not emit any items from the source Observable, but allow termination notification (either onError or onCompleted) to pass through unchanged. More... | |
template<class ResultType , class Operator > | |
auto | lift (Operator &&op) -> detail::lift_factory< ResultType, Operator > |
template<class... AN> | |
auto | map (AN &&...an) -> operator_factory< map_tag, AN... > |
For each item from this observable use Selector to produce an item to emit from the new observable that is returned. More... | |
template<class... AN> | |
auto | transform (AN &&...an) -> operator_factory< map_tag, AN... > |
For each item from this observable use Selector to produce an item to emit from the new observable that is returned. More... | |
template<class... AN> | |
auto | merge (AN &&...an) -> operator_factory< merge_tag, AN... > |
For each given observable subscribe. For each item emitted from all of the given observables, deliver from the new observable that is returned. More... | |
template<class... AN> | |
auto | multicast (AN &&...an) -> operator_factory< multicast_tag, AN... > |
allows connections to the source to be independent of subscriptions. More... | |
template<class... AN> | |
auto | observe_on (AN &&...an) -> operator_factory< observe_on_tag, AN... > |
All values are queued and delivered using the scheduler from the supplied coordination. More... | |
template<class... AN> | |
auto | on_error_resume_next (AN &&...an) -> operator_factory< on_error_resume_next_tag, AN... > |
If an error occurs, take the result from the Selector and subscribe to that instead. More... | |
template<class... AN> | |
auto | switch_on_error (AN &&...an) -> operator_factory< on_error_resume_next_tag, AN... > |
If an error occurs, take the result from the Selector and subscribe to that instead. More... | |
template<class... AN> | |
auto | pairwise (AN &&...an) -> operator_factory< pairwise_tag, AN... > |
Take values pairwise from this observable. More... | |
template<class... AN> | |
auto | publish (AN &&...an) -> operator_factory< publish_tag, AN... > |
Turn a cold observable hot and allow connections to the source to be independent of subscriptions. Turn a cold observable hot, send the most recent value to any new subscriber, and allow connections to the source to be independent of subscriptions. More... | |
template<class... AN> | |
auto | publish_synchronized (AN &&...an) -> operator_factory< publish_synchronized_tag, AN... > |
Turn a cold observable hot and allow connections to the source to be independent of subscriptions. More... | |
template<class... AN> | |
auto | reduce (AN &&...an) -> operator_factory< reduce_tag, AN... > |
For each item from this observable use Accumulator to combine items, when completed use ResultSelector to produce a value that will be emitted from the new observable that is returned. More... | |
template<class... AN> | |
auto | accumulate (AN &&...an) -> operator_factory< reduce_tag, AN... > |
For each item from this observable use Accumulator to combine items, when completed use ResultSelector to produce a value that will be emitted from the new observable that is returned. More... | |
auto | first () -> operator_factory< first_tag > |
For each item from this observable reduce it by sending only the first item. More... | |
auto | last () -> operator_factory< last_tag > |
For each item from this observable reduce it by sending only the last item. More... | |
auto | count () -> operator_factory< reduce_tag, int, rxu::count, rxu::detail::take_at< 0 >> |
For each item from this observable reduce it by incrementing a count. More... | |
auto | average () -> operator_factory< average_tag > |
For each item from this observable reduce it by adding to the previous values and then dividing by the number of items at the end. More... | |
auto | sum () -> operator_factory< sum_tag > |
For each item from this observable reduce it by adding to the previous items. More... | |
auto | min () -> operator_factory< min_tag > |
For each item from this observable reduce it by taking the min value of the previous items. More... | |
auto | max () -> operator_factory< max_tag > |
For each item from this observable reduce it by taking the max value of the previous items. More... | |
template<class... AN> | |
auto | ref_count (AN &&...an) -> operator_factory< ref_count_tag, AN... > |
takes a connectable_observable source and uses a ref_count of the subscribers to control the connection to the published source. The first subscription will cause a call to connect() and the last unsubscribe will unsubscribe the connection. More... | |
template<class... AN> | |
auto | repeat (AN &&...an) -> operator_factory< repeat_tag, AN... > |
Repeat this observable for the given number of times or infinitely. More... | |
template<class... AN> | |
auto | replay (AN &&...an) -> operator_factory< replay_tag, AN... > |
1) replay(optional Coordination, optional CompositeSubscription) Turn a cold observable hot, send all earlier emitted values to any new subscriber, and allow connections to the source to be independent of subscriptions. More... | |
template<class... AN> | |
auto | retry (AN &&...an) -> operator_factory< retry_tag, AN... > |
Retry this observable for the given number of times. More... | |
template<class... AN> | |
auto | sample_with_time (AN &&...an) -> operator_factory< sample_with_time_tag, AN... > |
Return an Observable that emits the most recent items emitted by the source Observable within periodic time intervals. More... | |
template<class... AN> | |
auto | scan (AN &&...an) -> operator_factory< scan_tag, AN... > |
For each item from this observable use Accumulator to combine items into a value that will be emitted from the new observable that is returned. More... | |
template<class... AN> | |
auto | sequence_equal (AN &&...an) -> operator_factory< sequence_equal_tag, AN... > |
Determine whether two Observables emit the same sequence of items. More... | |
template<class... AN> | |
auto | skip (AN &&...an) -> operator_factory< skip_tag, AN... > |
Make new observable with skipped first count items from this observable. More... | |
template<class... AN> | |
auto | skip_last (AN &&...an) -> operator_factory< skip_last_tag, AN... > |
Make new observable with skipped last count items from this observable. More... | |
template<class... AN> | |
auto | skip_until (AN &&...an) -> operator_factory< skip_until_tag, AN... > |
Make new observable with items skipped until on_next occurs on the trigger observable or until the specified time. skip_until takes (TriggerObservable, optional Coordination) or (TimePoint, optional Coordination) More... | |
template<class... AN> | |
auto | start_with (AN &&...an) -> operator_factory< start_with_tag, AN... > |
Start with the supplied values, then concatenate this observable. More... | |
template<class T , class... ArgN> | |
auto | subscribe (ArgN &&...an) -> detail::subscribe_factory< decltype(make_subscriber< T >(std::forward< ArgN >(an)...))> |
Subscribe will cause the source observable to emit values to the provided subscriber. More... | |
auto | as_dynamic () -> detail::dynamic_factory |
auto | as_blocking () -> detail::blocking_factory |
template<class... AN> | |
auto | subscribe_on (AN &&...an) -> operator_factory< subscribe_on_tag, AN... > |
Subscription and unsubscription are queued and delivered using the scheduler from the supplied coordination. More... | |
template<class... AN> | |
auto | switch_if_empty (AN &&...an) -> operator_factory< switch_if_empty_tag, AN... > |
If the source Observable terminates without emitting any items, emits items from a backup Observable. More... | |
template<class... AN> | |
auto | default_if_empty (AN &&...an) -> operator_factory< default_if_empty_tag, AN... > |
If the source Observable terminates without emitting any items, emits a default item and completes. More... | |
template<class... AN> | |
auto | switch_on_next (AN &&...an) -> operator_factory< switch_on_next_tag, AN... > |
Return observable that emits the items emitted by the observable most recently emitted by the source observable. More... | |
template<class... AN> | |
auto | take (AN &&...an) -> operator_factory< take_tag, AN... > |
For the first count items from this observable emit them from the new observable that is returned. More... | |
template<class... AN> | |
auto | take_last (AN &&...an) -> operator_factory< take_last_tag, AN... > |
Emit only the final t items emitted by the source Observable. More... | |
template<class... AN> | |
auto | take_until (AN &&...an) -> operator_factory< take_until_tag, AN... > |
For each item from this observable until on_next occurs on the trigger observable or until the specified time, emit them from the new observable that is returned. take_until takes (TriggerObservable, optional Coordination) or (TimePoint, optional Coordination) More... | |
template<class... AN> | |
auto | take_while (AN &&...an) -> operator_factory< take_while_tag, AN... > |
For the first items fulfilling the predicate from this observable emit them from the new observable that is returned. More... | |
template<class... AN> | |
auto | tap (AN &&...an) -> operator_factory< tap_tag, AN... > |
inspect calls to on_next, on_error and on_completed. More... | |
template<class... AN> | |
auto | time_interval (AN &&...an) -> operator_factory< time_interval_tag, AN... > |
Returns an observable that emits indications of the amount of time lapsed between consecutive emissions of the source observable. The first emission from this new Observable indicates the amount of time lapsed between the time when the observer subscribed to the Observable and the time when the source Observable emitted its first item. More... | |
template<class... AN> | |
auto | timeout (AN &&...an) -> operator_factory< timeout_tag, AN... > |
Return an observable that terminates with timeout_error if a particular timespan has passed without emitting another item from the source observable. More... | |
template<class... AN> | |
auto | timestamp (AN &&...an) -> operator_factory< timestamp_tag, AN... > |
Returns an observable that attaches a timestamp to each item emitted by the source observable indicating when it was emitted. More... | |
template<class... AN> | |
auto | window (AN &&...an) -> operator_factory< window_tag, AN... > |
Return an observable that emits connected, non-overlapping windows, each containing at most count items from the source observable. If the skip parameter is set, return an observable that emits windows every skip items containing at most count items from the source observable. More... | |
template<class... AN> | |
auto | window_with_time (AN &&...an) -> operator_factory< window_with_time_tag, AN... > |
Return an observable that emits observables every period time interval and collects items from this observable for period of time into each produced observable, on the specified scheduler. If the skip parameter is set, return an observable that emits observables every skip time interval and collects items from this observable for period of time into each produced observable, on the specified scheduler. More... | |
template<class... AN> | |
auto | window_with_time_or_count (AN &&...an) -> operator_factory< window_with_time_or_count_tag, AN... > |
Return an observable that emits connected, non-overlapping windows of items from the source observable that were emitted during a fixed duration of time or when the window has reached maximum capacity (whichever occurs first), on the specified scheduler. More... | |
template<class... AN> | |
auto | window_toggle (AN &&...an) -> operator_factory< window_toggle_tag, AN... > |
Return an observable that emits observables every period time interval and collects items from this observable for period of time into each produced observable, on the specified scheduler. More... | |
template<class... AN> | |
auto | with_latest_from (AN &&...an) -> operator_factory< with_latest_from_tag, AN... > |
For each item from the first observable select the latest value from all the observables to emit from the new observable that is returned. More... | |
template<class... AN> | |
auto | zip (AN &&...an) -> operator_factory< zip_tag, AN... > |
Bring by one item from all given observables and select a value to emit from the new observable that is returned. More... | |
Variables | |
auto | AN |
auto rxcpp::operators::accumulate | ( | AN &&... | an | ) | -> operator_factory<reduce_tag, AN...> |
For each item from this observable use Accumulator to combine items, when completed use ResultSelector to produce a value that will be emitted from the new observable that is returned.
Seed | the type of the initial value for the accumulator |
Accumulator | the type of the data accumulating function |
ResultSelector | the type of the result producing function |
seed | the initial value for the accumulator |
a | an accumulator function to be invoked on each item emitted by the source observable, the result of which will be used in the next accumulator call |
rs | a result producing function that makes the final value from the last accumulator call result |
Some basic reduce-type operators have already been implemented:
auto rxcpp::operators::all | ( | AN &&... | an | ) | -> operator_factory<all_tag, AN...> |
Returns an Observable that emits true if every item emitted by the source Observable satisfies a specified condition, otherwise false. Emits true if the source Observable terminates without emitting any item.
Predicate | the type of the test function. |
p | the test function to test items emitted by the source Observable. |
auto rxcpp::operators::amb | ( | AN &&... | an | ) | -> operator_factory<amb_tag, AN...> |
For each item from only the first of the given observables deliver from the new observable that is returned, on the specified scheduler.
There are 2 variants of the operator:
Coordination | the type of the scheduler (optional). |
Value0 | ... (optional). |
ValueN | types of source observables (optional). |
cn | the scheduler to synchronize sources from different contexts (optional). |
v0 | ... (optional). |
vn | source observables (optional). |
If scheduler is omitted, identity_current_thread is used.
auto rxcpp::operators::any | ( | AN &&... | an | ) | -> operator_factory<any_tag, AN...> |
Returns an Observable that emits true if any item emitted by the source Observable satisfies a specified condition, otherwise false. Emits false if the source Observable terminates without emitting any item.
Predicate | the type of the test function. |
p | the test function to test items emitted by the source Observable. |
Some basic any- operators have already been implemented:
|
inline |
Return a new observable that contains the blocking methods for this observable.
|
inline |
Return a new observable that performs type-forgetting conversion of this observable.
|
inline |
For each item from this observable reduce it by adding to the previous values and then dividing by the number of items at the end.
auto rxcpp::operators::buffer | ( | AN &&... | an | ) | -> operator_factory<buffer_count_tag, AN...> |
Return an observable that emits connected, non-overlapping buffer, each containing at most count items from the source observable. If the skip parameter is set, return an observable that emits buffers every skip items containing at most count items from the source observable.
count | the maximum size of each buffers before it should be emitted. |
skip | how many items need to be skipped before starting a new buffers (optional). |
auto rxcpp::operators::buffer_with_time | ( | AN &&... | an | ) | -> operator_factory<buffer_with_time_tag, AN...> |
Return an observable that emits buffers every period time interval and collects items from this observable for period of time into each produced buffer. If the skip parameter is set, Return an observable that emits buffers every skip time interval and collects items from this observable for period of time into each produced buffer, on the specified scheduler.
Duration | the type of the time interval |
Coordination | the type of the scheduler (optional). |
period | the period of time each buffer collects items before it is emitted. |
skip | the period of time after which a new buffer will be created (optional). |
coordination | the scheduler for the buffers (optional). |
auto rxcpp::operators::buffer_with_time_or_count | ( | AN &&... | an | ) | -> operator_factory<buffer_with_time_or_count_tag, AN...> |
Return an observable that emits connected, non-overlapping buffers of items from the source observable that were emitted during a fixed duration of time or when the buffer has reached maximum capacity (whichever occurs first), on the specified scheduler.
Duration | the type of the time interval. |
Coordination | the type of the scheduler (optional). |
period | the period of time each buffer collects items before it is emitted and replaced with a new buffer. |
count | the maximum size of each buffer before it is emitted and new buffer is created. |
coordination | the scheduler for the buffers (optional). |
auto rxcpp::operators::combine_latest | ( | AN &&... | an | ) | -> operator_factory<combine_latest_tag, AN...> |
For each item from all of the observables select a value to emit from the new observable that is returned.
AN | types of scheduler (optional), aggregate function (optional), and source observables |
an | scheduler (optional), aggregation function (optional), and source observables |
If scheduler is omitted, identity_current_thread is used.
If aggregation function is omitted, the resulting observable returns tuples of emitted items.
Neither scheduler nor aggregation function are present:
Only scheduler is present:
Only aggregation function is present:
Both scheduler and aggregation function are present:
auto rxcpp::operators::concat | ( | AN &&... | an | ) | -> operator_factory<concat_tag, AN...> |
For each item from this observable subscribe to one at a time, in the order received. For each item from all of the given observables deliver from the new observable that is returned.
There are 2 variants of the operator:
Coordination | the type of the scheduler (optional). |
Value0 | ... (optional). |
ValueN | types of source observables (optional). |
cn | the scheduler to synchronize sources from different contexts (optional). |
v0 | ... (optional). |
vn | source observables (optional). |
auto rxcpp::operators::concat_map | ( | AN &&... | an | ) | -> operator_factory<concat_map_tag, AN...> |
For each item from this observable use the CollectionSelector to produce an observable and subscribe to that observable. For each item from all of the produced observables use the ResultSelector to produce a value to emit from the new observable that is returned.
CollectionSelector | the type of the observable producing function. CollectionSelector must be a function with the signature: observable(concat_map::source_value_type) |
ResultSelector | the type of the aggregation function (optional). ResultSelector must be a function with the signature: concat_map::value_type(concat_map::source_value_type, concat_map::collection_value_type) |
Coordination | the type of the scheduler (optional). |
s | a function that returns an observable for each item emitted by the source observable. |
rs | a function that combines one item emitted by each of the source and collection observables and returns an item to be emitted by the resulting observable (optional). |
cn | the scheduler to synchronize sources from different contexts. (optional). |
Observables, produced by the CollectionSelector, are concatenated. There is another operator rxcpp::observable<T,SourceType>::flat_map that works similar but merges the observables.
auto rxcpp::operators::concat_transform | ( | AN &&... | an | ) | -> operator_factory<concat_map_tag, AN...> |
For each item from this observable use the CollectionSelector to produce an observable and subscribe to that observable. For each item from all of the produced observables use the ResultSelector to produce a value to emit from the new observable that is returned.
CollectionSelector | the type of the observable producing function. CollectionSelector must be a function with the signature: observable(concat_map::source_value_type) |
ResultSelector | the type of the aggregation function (optional). ResultSelector must be a function with the signature: concat_map::value_type(concat_map::source_value_type, concat_map::collection_value_type) |
Coordination | the type of the scheduler (optional). |
s | a function that returns an observable for each item emitted by the source observable. |
rs | a function that combines one item emitted by each of the source and collection observables and returns an item to be emitted by the resulting observable (optional). |
cn | the scheduler to synchronize sources from different contexts. (optional). |
Observables, produced by the CollectionSelector, are concatenated. There is another operator rxcpp::observable<T,SourceType>::flat_map that works similar but merges the observables.
auto rxcpp::operators::connect_forever | ( | AN &&... | an | ) | -> operator_factory<connect_forever_tag, AN...> |
takes a connectable_observable source and calls connect during the construction of the expression. This means that the source starts running without any subscribers and continues running after all subscriptions have been unsubscribed.
auto rxcpp::operators::contains | ( | AN &&... | an | ) | -> operator_factory<contains_tag, AN...> |
Returns an Observable that emits true if the source Observable emitted a specified item, otherwise false. Emits false if the source Observable terminates without emitting any item.
T | the type of the item to search for. |
value | the item to search for. |
|
inline |
For each item from this observable reduce it by incrementing a count.
auto rxcpp::operators::debounce | ( | AN &&... | an | ) | -> operator_factory<debounce_tag, AN...> |
Return an observable that emits an item if a particular timespan has passed without emitting another item from the source observable.
Duration | the type of the time interval |
Coordination | the type of the scheduler |
period | the period of time to suppress any emitted items |
coordination | the scheduler to manage timeout for each event |
auto rxcpp::operators::default_if_empty | ( | AN &&... | an | ) | -> operator_factory<default_if_empty_tag, AN...> |
If the source Observable terminates without emitting any items, emits a default item and completes.
Value | the type of the value to emit. |
v | the default value to emit. |
auto rxcpp::operators::delay | ( | AN &&... | an | ) | -> operator_factory<delay_tag, AN...> |
Return an observable that emits each item emitted by the source observable after the specified delay.
Duration | the type of time interval |
Coordination | the type of the scheduler |
period | the period of time each item is delayed |
coordination | the scheduler for the delays |
auto rxcpp::operators::distinct | ( | AN &&... | an | ) | -> operator_factory<distinct_tag, AN...> |
For each item from this observable, filter out repeated values and emit only items that have not already been emitted.
auto rxcpp::operators::distinct_until_changed | ( | AN &&... | an | ) | -> operator_factory<distinct_until_changed_tag, AN...> |
For each item from this observable, filter out consequentially repeated values and emit only changes from the new observable that is returned.
BinaryPredicate | (optional) the type of the value comparing function. The signature should be equivalent to the following: bool pred(const T1& a, const T2& b); |
pred | (optional) the function that implements comparison of two values. |
auto rxcpp::operators::element_at | ( | AN &&... | an | ) | -> operator_factory<element_at_tag, AN...> |
Pulls an item located at a specified index location in the sequence of items and emits that item as its own sole emission.
index | the index of the element to return. |
auto rxcpp::operators::exists | ( | AN &&... | an | ) | -> operator_factory<exists_tag, AN...> |
Returns an Observable that emits true if any item emitted by the source Observable satisfies a specified condition, otherwise false. Emits false if the source Observable terminates without emitting any item.
Predicate | the type of the test function. |
p | the test function to test items emitted by the source Observable. |
auto rxcpp::operators::filter | ( | AN &&... | an | ) | -> operator_factory<filter_tag, AN...> |
For each item from this observable use Predicate to select which items to emit from the new observable that is returned.
Predicate | the type of the filter function |
p | the filter function |
|
final |
Add a new action at the end of the new observable that is returned.
LastCall | the type of the action function |
lc | the action function |
|
inline |
For each item from this observable reduce it by sending only the first item.
auto rxcpp::operators::flat_map | ( | AN &&... | an | ) | -> operator_factory<flat_map_tag, AN...> |
For each item from this observable use the CollectionSelector to produce an observable and subscribe to that observable. For each item from all of the produced observables use the ResultSelector to produce a value to emit from the new observable that is returned.
CollectionSelector | the type of the observable producing function. CollectionSelector must be a function with the signature observable(flat_map::source_value_type) |
ResultSelector | the type of the aggregation function (optional). ResultSelector must be a function with the signature flat_map::value_type(flat_map::source_value_type, flat_map::collection_value_type). |
Coordination | the type of the scheduler (optional). |
s | a function that returns an observable for each item emitted by the source observable. |
rs | a function that combines one item emitted by each of the source and collection observables and returns an item to be emitted by the resulting observable (optional). |
cn | the scheduler to synchronize sources from different contexts (optional). |
Observables, produced by the CollectionSelector, are merged. There is another operator rxcpp::observable<T,SourceType>::flat_map that works similar but concatenates the observables.
auto rxcpp::operators::group_by | ( | AN &&... | an | ) | -> operator_factory<group_by_tag, AN...> |
Return an observable that emits grouped_observables, each of which corresponds to a unique key value and each of which emits those items from the source observable that share that key value.
KeySelector | the type of the key extracting function |
MarbleSelector | the type of the element extracting function |
BinaryPredicate | the type of the key comparing function |
ks | a function that extracts the key for each item (optional) |
ms | a function that extracts the return element for each item (optional) |
p | a function that implements comparison of two keys (optional) |
auto rxcpp::operators::ignore_elements | ( | AN &&... | an | ) | -> operator_factory<ignore_elements_tag, AN...> |
Do not emit any items from the source Observable, but allow termination notification (either onError or onCompleted) to pass through unchanged.
auto rxcpp::operators::is_empty | ( | AN &&... | an | ) | -> operator_factory<is_empty_tag, AN...> |
Returns an Observable that emits true if the source Observable is empty, otherwise false.
|
inline |
For each item from this observable reduce it by sending only the last item.
auto rxcpp::operators::lift | ( | Operator && | op | ) | -> detail::lift_factory<ResultType, Operator> |
auto rxcpp::operators::map | ( | AN &&... | an | ) | -> operator_factory<map_tag, AN...> |
For each item from this observable use Selector to produce an item to emit from the new observable that is returned.
Selector | the type of the transforming function |
s | the selector function |
|
inline |
For each item from this observable reduce it by taking the max value of the previous items.
auto rxcpp::operators::merge | ( | AN &&... | an | ) | -> operator_factory<merge_tag, AN...> |
For each given observable subscribe. For each item emitted from all of the given observables, deliver from the new observable that is returned.
There are 2 variants of the operator:
Coordination | the type of the scheduler (optional). |
Value0 | ... (optional). |
ValueN | types of source observables (optional). |
cn | the scheduler to synchronize sources from different contexts (optional). |
v0 | ... (optional). |
vn | source observables (optional). |
If scheduler is omitted, identity_current_thread is used.
auto rxcpp::operators::merge_transform | ( | AN &&... | an | ) | -> operator_factory<flat_map_tag, AN...> |
For each item from this observable use the CollectionSelector to produce an observable and subscribe to that observable. For each item from all of the produced observables use the ResultSelector to produce a value to emit from the new observable that is returned.
CollectionSelector | the type of the observable producing function. CollectionSelector must be a function with the signature observable(flat_map::source_value_type) |
ResultSelector | the type of the aggregation function (optional). ResultSelector must be a function with the signature flat_map::value_type(flat_map::source_value_type, flat_map::collection_value_type). |
Coordination | the type of the scheduler (optional). |
s | a function that returns an observable for each item emitted by the source observable. |
rs | a function that combines one item emitted by each of the source and collection observables and returns an item to be emitted by the resulting observable (optional). |
cn | the scheduler to synchronize sources from different contexts (optional). |
Observables, produced by the CollectionSelector, are merged. There is another operator rxcpp::observable<T,SourceType>::flat_map that works similar but concatenates the observables.
|
inline |
For each item from this observable reduce it by taking the min value of the previous items.
auto rxcpp::operators::multicast | ( | AN &&... | an | ) | -> operator_factory<multicast_tag, AN...> |
allows connections to the source to be independent of subscriptions.
Subject | the subject to multicast the source Observable. |
sub | the subject. |
auto rxcpp::operators::observe_on | ( | AN &&... | an | ) | -> operator_factory<observe_on_tag, AN...> |
All values are queued and delivered using the scheduler from the supplied coordination.
Coordination | the type of the scheduler. |
cn | the scheduler to notify observers on. |
auto rxcpp::operators::on_error_resume_next | ( | AN &&... | an | ) | -> operator_factory<on_error_resume_next_tag, AN...> |
If an error occurs, take the result from the Selector and subscribe to that instead.
Selector | the actual type of a function of the form observable<T>(std::exception_ptr) |
s | the function of the form observable<T>(std::exception_ptr) |
auto rxcpp::operators::pairwise | ( | AN &&... | an | ) | -> operator_factory<pairwise_tag, AN...> |
Take values pairwise from this observable.
auto rxcpp::operators::publish | ( | AN &&... | an | ) | -> operator_factory<publish_tag, AN...> |
Turn a cold observable hot and allow connections to the source to be independent of subscriptions. Turn a cold observable hot, send the most recent value to any new subscriber, and allow connections to the source to be independent of subscriptions.
T | the type of the emitted item (optional). |
first | an initial item to be emitted by the resulting observable at connection time before emitting the items from the source observable; not emitted to observers that subscribe after the time of connection (optional). |
cs | the subscription to control lifetime (optional). |
auto rxcpp::operators::publish_synchronized | ( | AN &&... | an | ) | -> operator_factory<publish_synchronized_tag, AN...> |
Turn a cold observable hot and allow connections to the source to be independent of subscriptions.
Coordination | the type of the scheduler. |
cn | a scheduler all values are queued and delivered on. |
cs | the subscription to control lifetime (optional). |
auto rxcpp::operators::reduce | ( | AN &&... | an | ) | -> operator_factory<reduce_tag, AN...> |
For each item from this observable use Accumulator to combine items, when completed use ResultSelector to produce a value that will be emitted from the new observable that is returned.
Seed | the type of the initial value for the accumulator |
Accumulator | the type of the data accumulating function |
ResultSelector | the type of the result producing function |
seed | the initial value for the accumulator |
a | an accumulator function to be invoked on each item emitted by the source observable, the result of which will be used in the next accumulator call |
rs | a result producing function that makes the final value from the last accumulator call result |
Some basic reduce-type operators have already been implemented:
auto rxcpp::operators::ref_count | ( | AN &&... | an | ) | -> operator_factory<ref_count_tag, AN...> |
takes a connectable_observable source and uses a ref_count of the subscribers to control the connection to the published source. The first subscription will cause a call to connect() and the last unsubscribe will unsubscribe the connection.
auto rxcpp::operators::repeat | ( | AN &&... | an | ) | -> operator_factory<repeat_tag, AN...> |
Repeat this observable for the given number of times or infinitely.
Count | the type of the counter (optional). |
t | The number of times the source observable items are repeated (optional). If not specified, infinitely repeats the source observable. Specifying 0 returns an empty sequence immediately |
auto rxcpp::operators::replay | ( | AN &&... | an | ) | -> operator_factory<replay_tag, AN...> |
1) replay(optional Coordination, optional CompositeSubscription) Turn a cold observable hot, send all earlier emitted values to any new subscriber, and allow connections to the source to be independent of subscriptions.
2) replay(Count, optional Coordination, optional CompositeSubscription) Turn a cold observable hot, send at most count of earlier emitted values to any new subscriber, and allow connections to the source to be independent of subscriptions.
3) replay(Duration, optional Coordination, optional CompositeSubscription) Turn a cold observable hot, send values emitted within a specified time window to any new subscriber, and allow connections to the source to be independent of subscriptions.
4) replay(Count, Duration, optional Coordination, optional CompositeSubscription) Turn a cold observable hot, send at most count of values emitted within a specified time window to any new subscriber, and allow connections to the source to be independent of subscriptions.
Duration | the type of the time interval (optional). |
Count | the type of the maximum number of the most recent items sent to new observers (optional). |
Coordination | the type of the scheduler (optional). |
count | the maximum number of the most recent items sent to new observers (optional). |
d | the duration of the window in which the replayed items must be emitted |
cn | a scheduler all values are queued and delivered on (optional). |
cs | the subscription to control lifetime (optional). |
auto rxcpp::operators::retry | ( | AN &&... | an | ) | -> operator_factory<retry_tag, AN...> |
Retry this observable for the given number of times.
Count | the type of the counter (optional) |
t | the total number of tries (optional), i.e. retry(2) means one normal try, before an error occurs, and one retry. If not specified, infinitely retries the source observable. Specifying 0 returns immediately without subscribing |
auto rxcpp::operators::sample_with_time | ( | AN &&... | an | ) | -> operator_factory<sample_with_time_tag, AN...> |
Return an Observable that emits the most recent items emitted by the source Observable within periodic time intervals.
Duration | the type of time interval. |
Coordination | the type of the scheduler (optional). |
period | the period of time to sample the source observable. |
coordination | the scheduler for the items (optional). |
auto rxcpp::operators::scan | ( | AN &&... | an | ) | -> operator_factory<scan_tag, AN...> |
For each item from this observable use Accumulator to combine items into a value that will be emitted from the new observable that is returned.
Seed | the type of the initial value for the accumulator. |
Accumulator | the type of the data accumulating function. |
seed | the initial value for the accumulator. |
a | an accumulator function to be invoked on each item emitted by the source observable, whose result will be emitted and used in the next accumulator call. |
auto rxcpp::operators::sequence_equal | ( | AN &&... | an | ) | -> operator_factory<sequence_equal_tag, AN...> |
Determine whether two Observables emit the same sequence of items.
OtherSource | the type of the other observable. |
BinaryPredicate | the type of the value comparing function (optional). The signature should be equivalent to the following: bool pred(const T1& a, const T2& b); |
Coordination | the type of the scheduler (optional). |
t | the other Observable that emits items to compare. |
pred | the function that implements comparison of two values (optional). |
cn | the scheduler (optional). |
auto rxcpp::operators::skip | ( | AN &&... | an | ) | -> operator_factory<skip_tag, AN...> |
Make new observable with skipped first count items from this observable.
Count | the type of the items counter |
t | the number of items to skip |
auto rxcpp::operators::skip_last | ( | AN &&... | an | ) | -> operator_factory<skip_last_tag, AN...> |
Make new observable with skipped last count items from this observable.
Count | the type of the items counter. |
t | the number of last items to skip. |
auto rxcpp::operators::skip_until | ( | AN &&... | an | ) | -> operator_factory<skip_until_tag, AN...> |
Make new observable with items skipped until on_next occurs on the trigger observable or until the specified time. skip_until takes (TriggerObservable, optional Coordination) or (TimePoint, optional Coordination)
TriggerSource | the type of the trigger observable. |
Coordination | the type of the scheduler (optional). |
t | an observable that has to emit an item before the source observable's elements begin to be mirrored by the resulting observable. |
cn | the scheduler to use for scheduling the items (optional). |
auto rxcpp::operators::start_with | ( | AN &&... | an | ) | -> operator_factory<start_with_tag, AN...> |
Start with the supplied values, then concatenate this observable.
Value0 | ... |
ValueN | the type of sending values |
v0 | ... |
vn | values to send |
auto rxcpp::operators::subscribe | ( | ArgN &&... | an | ) | -> detail::subscribe_factory<decltype (make_subscriber<T>(std::forward<ArgN>(an)...))> |
Subscribe will cause the source observable to emit values to the provided subscriber.
ArgN | types of the subscriber parameters |
an | the parameters for making a subscriber |
The arguments of subscribe are forwarded to rxcpp::make_subscriber function. Some possible alternatives are:
on_next
handler: on_next
and on_error
handlers: on_next
and on_completed
handlers: on_next
, on_error
, and on_completed
handlers: All the alternatives above also support passing rxcpp::composite_subscription instance. For example:
If neither subscription nor subscriber are provided, then a new subscription is created and returned as a result:
For more details, see rxcpp::make_subscriber function description.
auto rxcpp::operators::subscribe_on | ( | AN &&... | an | ) | -> operator_factory<subscribe_on_tag, AN...> |
Subscription and unsubscription are queued and delivered using the scheduler from the supplied coordination.
Coordination | the type of the scheduler. |
cn | the scheduler to perform subscription actions on. |
|
inline |
For each item from this observable reduce it by adding to the previous items.
auto rxcpp::operators::switch_if_empty | ( | AN &&... | an | ) | -> operator_factory<switch_if_empty_tag, AN...> |
If the source Observable terminates without emitting any items, emits items from a backup Observable.
BackupSource | the type of the backup observable. |
t | a backup observable that is used if the source observable is empty. |
auto rxcpp::operators::switch_on_error | ( | AN &&... | an | ) | -> operator_factory<on_error_resume_next_tag, AN...> |
If an error occurs, take the result from the Selector and subscribe to that instead.
Selector | the actual type of a function of the form observable<T>(std::exception_ptr) |
s | the function of the form observable<T>(std::exception_ptr) |
auto rxcpp::operators::switch_on_next | ( | AN &&... | an | ) | -> operator_factory<switch_on_next_tag, AN...> |
Return observable that emits the items emitted by the observable most recently emitted by the source observable.
Coordination | the type of the scheduler (optional). |
cn | the scheduler to synchronize sources from different contexts (optional). |
auto rxcpp::operators::take | ( | AN &&... | an | ) | -> operator_factory<take_tag, AN...> |
For the first count items from this observable emit them from the new observable that is returned.
Count | the type of the items counter. |
t | the number of items to take. |
auto rxcpp::operators::take_last | ( | AN &&... | an | ) | -> operator_factory<take_last_tag, AN...> |
Emit only the final t items emitted by the source Observable.
Count | the type of the items counter. |
t | the number of last items to take. |
auto rxcpp::operators::take_until | ( | AN &&... | an | ) | -> operator_factory<take_until_tag, AN...> |
For each item from this observable until on_next occurs on the trigger observable or until the specified time, emit them from the new observable that is returned. take_until takes (TriggerObservable, optional Coordination) or (TimePoint, optional Coordination)
TriggerSource | the type of the trigger observable. |
TimePoint | the type of the time interval. |
Coordination | the type of the scheduler (optional). |
t | an observable whose first emitted item will stop emitting items from the source observable. |
when | a time point when the returned observable will stop emitting items. |
cn | the scheduler to use for scheduling the items (optional). |
auto rxcpp::operators::take_while | ( | AN &&... | an | ) | -> operator_factory<take_while_tag, AN...> |
For the first items fulfilling the predicate from this observable emit them from the new observable that is returned.
Predicate | the type of the predicate |
t | the predicate |
auto rxcpp::operators::tap | ( | AN &&... | an | ) | -> operator_factory<tap_tag, AN...> |
inspect calls to on_next, on_error and on_completed.
MakeObserverArgN... | these args are passed to make_observer. |
an | these args are passed to make_observer. |
auto rxcpp::operators::time_interval | ( | AN &&... | an | ) | -> operator_factory<time_interval_tag, AN...> |
Returns an observable that emits indications of the amount of time lapsed between consecutive emissions of the source observable. The first emission from this new Observable indicates the amount of time lapsed between the time when the observer subscribed to the Observable and the time when the source Observable emitted its first item.
Coordination | the type of the scheduler. |
coordination | the scheduler for time intervals. |
auto rxcpp::operators::timeout | ( | AN &&... | an | ) | -> operator_factory<timeout_tag, AN...> |
Return an observable that terminates with timeout_error if a particular timespan has passed without emitting another item from the source observable.
Duration | the type of time interval. |
Coordination | the type of the scheduler (optional). |
period | the period of time wait for another item from the source observable. |
coordination | the scheduler to manage timeout for each event (optional). |
auto rxcpp::operators::timestamp | ( | AN &&... | an | ) | -> operator_factory<timestamp_tag, AN...> |
Returns an observable that attaches a timestamp to each item emitted by the source observable indicating when it was emitted.
Coordination | the type of the scheduler (optional). |
coordination | the scheduler to manage timeout for each event (optional). |
auto rxcpp::operators::transform | ( | AN &&... | an | ) | -> operator_factory<map_tag, AN...> |
For each item from this observable use Selector to produce an item to emit from the new observable that is returned.
Selector | the type of the transforming function |
s | the selector function |
auto rxcpp::operators::window | ( | AN &&... | an | ) | -> operator_factory<window_tag, AN...> |
Return an observable that emits connected, non-overlapping windows, each containing at most count items from the source observable. If the skip parameter is set, return an observable that emits windows every skip items containing at most count items from the source observable.
count | the maximum size of each window before it should be completed |
skip | how many items need to be skipped before starting a new window |
auto rxcpp::operators::window_toggle | ( | AN &&... | an | ) | -> operator_factory<window_toggle_tag, AN...> |
Return an observable that emits observables every period time interval and collects items from this observable for period of time into each produced observable, on the specified scheduler.
Openings | observable<OT> |
ClosingSelector | a function of type observable<CT>(OT) |
Coordination | the type of the scheduler (optional). |
opens | each value from this observable opens a new window. |
closes | this function is called for each opened window and returns an observable. the first value from the returned observable will close the window. |
coordination | the scheduler for the windows (optional). |
auto rxcpp::operators::window_with_time | ( | AN &&... | an | ) | -> operator_factory<window_with_time_tag, AN...> |
Return an observable that emits observables every period time interval and collects items from this observable for period of time into each produced observable, on the specified scheduler. If the skip parameter is set, return an observable that emits observables every skip time interval and collects items from this observable for period of time into each produced observable, on the specified scheduler.
Duration | the type of time intervals. |
Coordination | the type of the scheduler (optional). |
period | the period of time each window collects items before it is completed. |
skip | the period of time after which a new window will be created. |
coordination | the scheduler for the windows (optional). |
auto rxcpp::operators::window_with_time_or_count | ( | AN &&... | an | ) | -> operator_factory<window_with_time_or_count_tag, AN...> |
Return an observable that emits connected, non-overlapping windows of items from the source observable that were emitted during a fixed duration of time or when the window has reached maximum capacity (whichever occurs first), on the specified scheduler.
Duration | the type of time intervals. |
Coordination | the type of the scheduler (optional). |
period | the period of time each window collects items before it is completed and replaced with a new window. |
count | the maximum size of each window before it is completed and new window is created. |
coordination | the scheduler for the windows (optional). |
auto rxcpp::operators::with_latest_from | ( | AN &&... | an | ) | -> operator_factory<with_latest_from_tag, AN...> |
For each item from the first observable select the latest value from all the observables to emit from the new observable that is returned.
AN | types of scheduler (optional), aggregate function (optional), and source observables |
an | scheduler (optional), aggregation function (optional), and source observables |
If scheduler is omitted, identity_current_thread is used.
If aggregation function is omitted, the resulting observable returns tuples of emitted items.
Neither scheduler nor aggregation function are present:
Only scheduler is present:
Only aggregation function is present:
Both scheduler and aggregation function are present:
auto rxcpp::operators::zip | ( | AN &&... | an | ) | -> operator_factory<zip_tag, AN...> |
Bring by one item from all given observables and select a value to emit from the new observable that is returned.
AN | types of scheduler (optional), aggregate function (optional), and source observables |
an | scheduler (optional), aggregation function (optional), and source observables |
If scheduler is omitted, identity_current_thread is used.
If aggregation function is omitted, the resulting observable returns tuples of emitted items.
Neither scheduler nor aggregation function are present:
Only scheduler is present:
Only aggregation function is present:
Both scheduler and aggregation function are present:
auto rxcpp::operators::AN |