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 | Namespaces | Macros | Functions
rx-scan.hpp File Reference

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...

#include "../rx-includes.hpp"
Include dependency graph for rx-scan.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  rxcpp::member_overload< scan_tag >
 

Namespaces

 rxcpp
 
 rxcpp::operators
 

Macros

#define RXCPP_OPERATORS_RX_SCAN_HPP
 

Functions

template<class... AN>
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. More...
 

Detailed Description

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.

Template Parameters
Seedthe type of the initial value for the accumulator.
Accumulatorthe type of the data accumulating function.
Parameters
seedthe initial value for the accumulator.
aan 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.
Returns
An observable that emits the results of each call to the accumulator function.
Sample Code
auto values = rxcpp::observable<>::range(1, 7).
0,
[](int seed, int v){
return seed + v;
});
values.
[](int v){printf("OnNext: %d\n", v);},
[](){printf("OnCompleted\n");});
OnNext: 1
OnNext: 3
OnNext: 6
OnNext: 10
OnNext: 15
OnNext: 21
OnNext: 28
OnCompleted

Macro Definition Documentation

#define RXCPP_OPERATORS_RX_SCAN_HPP