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

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

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

Namespaces

 rxcpp
 
 rxcpp::operators
 

Macros

#define RXCPP_OPERATORS_RX_TAKE_HPP
 

Functions

template<class... AN>
auto rxcpp::operators::take (AN &&...an) -> operator_factory< take_tag, AN... >
 For the first count items from this observable emit them from the new observable that is returned. More...
 

Detailed Description

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

Template Parameters
Countthe type of the items counter.
Parameters
tthe number of items to take.
Returns
An observable that emits only the first t items emitted by the source Observable, or all of the items from the source observable if that observable emits fewer than t items.
Sample Code
auto values = rxcpp::observable<>::range(1, 7).take(3);
values.
[](int v){printf("OnNext: %d\n", v);},
[](){printf("OnCompleted\n");});
OnNext: 1
OnNext: 2
OnNext: 3
OnCompleted

Macro Definition Documentation

#define RXCPP_OPERATORS_RX_TAKE_HPP