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

Return an observable that emits connected, non-overlapping buffer, each containing at most count items from the source observable. If the skip parameter is set, return an observable that emits buffers every skip items containing at most count items from the source observable. More...

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

Namespaces

 rxcpp
 
 rxcpp::operators
 

Macros

#define RXCPP_OPERATORS_RX_BUFFER_COUNT_HPP
 

Functions

template<class... AN>
auto rxcpp::operators::buffer (AN &&...an) -> operator_factory< buffer_count_tag, AN... >
 Return an observable that emits connected, non-overlapping buffer, each containing at most count items from the source observable. If the skip parameter is set, return an observable that emits buffers every skip items containing at most count items from the source observable. More...
 

Detailed Description

Return an observable that emits connected, non-overlapping buffer, each containing at most count items from the source observable. If the skip parameter is set, return an observable that emits buffers every skip items containing at most count items from the source observable.

Parameters
countthe maximum size of each buffers before it should be emitted.
skiphow many items need to be skipped before starting a new buffers (optional).
Returns
Observable that emits connected, non-overlapping buffers, each containing at most count items from the source observable. If the skip parameter is set, return an Observable that emits buffers every skip items containing at most count items from the source observable.
Sample Code
auto values = rxcpp::observable<>::range(1, 5).buffer(2);
values.
[](std::vector<int> v){
printf("OnNext:");
std::for_each(v.begin(), v.end(), [](int a){
printf(" %d", a);
});
printf("\n");
},
[](){printf("OnCompleted\n");});
OnNext: 1 2
OnNext: 3 4
OnNext: 5
OnCompleted
Sample Code
auto values = rxcpp::observable<>::range(1, 7).buffer(2, 3);
values.
[](std::vector<int> v){
printf("OnNext:");
std::for_each(v.begin(), v.end(), [](int a){
printf(" %d", a);
});
printf("\n");
},
[](){printf("OnCompleted\n");});
OnNext: 1 2
OnNext: 4 5
OnNext: 7
OnCompleted

Macro Definition Documentation

#define RXCPP_OPERATORS_RX_BUFFER_COUNT_HPP