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

For each item from this observable use Predicate to select which items to emit from the new observable that is returned. More...

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

Namespaces

 rxcpp
 
 rxcpp::operators
 

Macros

#define RXCPP_OPERATORS_RX_FILTER_HPP
 

Functions

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

Detailed Description

For each item from this observable use Predicate to select which items to emit from the new observable that is returned.

Template Parameters
Predicatethe type of the filter function
Parameters
pthe filter function
Returns
Observable that emits only those items emitted by the source observable that the filter evaluates as true.
Sample Code
auto values = rxcpp::observable<>::range(1, 6).
filter([](int v){
return v % 2;
});
values.
[](int v){printf("OnNext: %d\n", v);},
[](){printf("OnCompleted\n");});
OnNext: 1
OnNext: 3
OnNext: 5
OnCompleted

Macro Definition Documentation

#define RXCPP_OPERATORS_RX_FILTER_HPP