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

Emit only the final t items emitted by the source Observable. More...

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

Namespaces

 rxcpp
 
 rxcpp::operators
 

Macros

#define RXCPP_OPERATORS_RX_TAKE_LAST_HPP
 

Functions

template<class... AN>
auto rxcpp::operators::take_last (AN &&...an) -> operator_factory< take_last_tag, AN... >
 Emit only the final t items emitted by the source Observable. More...
 

Detailed Description

Emit only the final t items emitted by the source Observable.

Template Parameters
Countthe type of the items counter.
Parameters
tthe number of last items to take.
Returns
An observable that emits only the last 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_last(3);
values.
[](int v){printf("OnNext: %d\n", v);},
[](){printf("OnCompleted\n");});
OnNext: 5
OnNext: 6
OnNext: 7
OnCompleted

Macro Definition Documentation

#define RXCPP_OPERATORS_RX_TAKE_LAST_HPP