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-sample_time.hpp File Reference

Return an Observable that emits the most recent items emitted by the source Observable within periodic time intervals. More...

#include "../rx-includes.hpp"
Include dependency graph for rx-sample_time.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< sample_with_time_tag >
 

Namespaces

 rxcpp
 
 rxcpp::operators
 

Macros

#define RXCPP_OPERATORS_RX_SAMPLE_WITH_TIME_HPP
 

Functions

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

Detailed Description

Return an Observable that emits the most recent items emitted by the source Observable within periodic time intervals.

Template Parameters
Durationthe type of time interval.
Coordinationthe type of the scheduler (optional).
Parameters
periodthe period of time to sample the source observable.
coordinationthe scheduler for the items (optional).
Returns
Observable that emits the most recently emitted item since the previous sampling.
Sample Code
auto values = rxcpp::observable<>::interval(std::chrono::milliseconds(2)).
take(7).
sample_with_time(std::chrono::milliseconds(4));
values.
[](long v) {
printf("OnNext: %ld\n", v);
},
[]() { printf("OnCompleted\n"); });
OnNext: 1
OnNext: 3
OnNext: 5
OnCompleted

Macro Definition Documentation

#define RXCPP_OPERATORS_RX_SAMPLE_WITH_TIME_HPP