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

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\n
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

◆ RXCPP_OPERATORS_RX_TAKE_WHILE_HPP

#define RXCPP_OPERATORS_RX_TAKE_WHILE_HPP
rxcpp::sources::range
auto range(T first=0, T last=std::numeric_limits< T >::max(), std::ptrdiff_t step=1) -> observable< T, detail::range< T, identity_one_worker >>
Definition: rx-range.hpp:119
rxcpp::operators::subscribe
auto subscribe(ArgN &&... an) -> detail::subscribe_factory< decltype(make_subscriber< T >(std::forward< ArgN >(an)...))>
Definition: rx-subscribe.hpp:87
rxcpp::operators::take_while
auto take_while(AN &&... an) -> operator_factory< take_while_tag, AN... >
Definition: rx-take_while.hpp:100