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

For the first items fulfilling the predicate from this observable emit them from the new observable that is returned. More...

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

Namespaces

 rxcpp
 
 rxcpp::operators
 

Macros

#define RXCPP_OPERATORS_RX_TAKE_WHILE_HPP
 

Functions

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

Detailed Description

For the first items fulfilling the predicate from this observable emit them from the new observable that is returned.

Template Parameters
Predicatethe type of the predicate
Parameters
tthe predicate
Returns
An observable that emits only the first items emitted by the source Observable fulfilling the predicate, or all of the items from the source observable if the predicate never returns false
Sample Code
auto values = rxcpp::observable<>::range(1, 8).
take_while([](int v){
return v <= 4;
});
values.
[](int v){printf("OnNext: %d\n", v);},
[](){printf("OnCompleted\n");});
OnNext: 1
OnNext: 2
OnNext: 3
OnNext: 4
OnCompleted

Macro Definition Documentation

#define RXCPP_OPERATORS_RX_TAKE_WHILE_HPP