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

Return an observable that emits an item if a particular timespan has passed without emitting another item from the source observable. More...

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

Namespaces

 rxcpp
 
 rxcpp::operators
 

Macros

#define RXCPP_OPERATORS_RX_DEBOUNCE_HPP
 

Functions

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

Detailed Description

Return an observable that emits an item if a particular timespan has passed without emitting another item from the source observable.

Template Parameters
Durationthe type of the time interval
Coordinationthe type of the scheduler
Parameters
periodthe period of time to suppress any emitted items
coordinationthe scheduler to manage timeout for each event
Returns
Observable that emits an item if a particular timespan has passed without emitting another item from the source observable.
Sample Code
using namespace std::chrono;
auto scheduler = rxcpp::identity_current_thread();
auto start = scheduler.now();
auto period = milliseconds(10);
auto values = rxcpp::observable<>::interval(start, period, scheduler).
take(4).
debounce(period);
values.
[](long v) { printf("OnNext: %ld\n", v); },
[]() { printf("OnCompleted\n"); });
OnNext: 1
OnNext: 2
OnNext: 4
OnCompleted

Macro Definition Documentation

#define RXCPP_OPERATORS_RX_DEBOUNCE_HPP