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++.
Namespaces | Macros | Functions
rx-iterate.hpp File Reference

Returns an observable that sends each value in the collection, on the specified scheduler. More...

#include "../rx-includes.hpp"
Include dependency graph for rx-iterate.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 rxcpp
 
 rxcpp::sources
 

Macros

#define RXCPP_SOURCES_RX_ITERATE_HPP
 

Functions

template<class Collection >
auto rxcpp::sources::iterate (Collection c) -> observable< rxu::value_type_t< detail::iterate_traits< Collection >>, detail::iterate< Collection, identity_one_worker >>
 Returns an observable that sends each value in the collection, on the specified scheduler. More...
 
template<class Collection , class Coordination >
auto rxcpp::sources::iterate (Collection c, Coordination cn) -> observable< rxu::value_type_t< detail::iterate_traits< Collection >>, detail::iterate< Collection, Coordination >>
 Returns an observable that sends each value in the collection, on the specified scheduler. More...
 
template<class T >
auto rxcpp::sources::from () -> decltype(iterate(std::array< T, 0 >(), identity_immediate()))
 
template<class T , class Coordination >
auto rxcpp::sources::from (Coordination cn) -> typename std::enable_if< is_coordination< Coordination >::value, decltype( iterate(std::array< T, 0 >(), std::move(cn)))>::type
 
template<class Value0 , class... ValueN>
auto rxcpp::sources::from (Value0 v0, ValueN...vn) -> typename std::enable_if<!is_coordination< Value0 >::value, decltype(iterate(*(std::array< Value0, sizeof...(ValueN)+1 > *) nullptr, identity_immediate()))>::type
 
template<class Coordination , class Value0 , class... ValueN>
auto rxcpp::sources::from (Coordination cn, Value0 v0, ValueN...vn) -> typename std::enable_if< is_coordination< Coordination >::value, decltype(iterate(*(std::array< Value0, sizeof...(ValueN)+1 > *) nullptr, std::move(cn)))>::type
 
template<class Value0 >
auto rxcpp::sources::just (Value0 v0) -> typename std::enable_if<!is_coordination< Value0 >::value, decltype(iterate(*(std::array< Value0, 1 > *) nullptr, identity_immediate()))>::type
 
template<class Value0 , class Coordination >
auto rxcpp::sources::just (Value0 v0, Coordination cn) -> typename std::enable_if< is_coordination< Coordination >::value, decltype(iterate(*(std::array< Value0, 1 > *) nullptr, std::move(cn)))>::type
 
template<class Observable , class Value0 , class... ValueN>
auto rxcpp::sources::start_with (Observable o, Value0 v0, ValueN...vn) -> decltype(from(rxu::value_type_t< Observable >(v0), rxu::value_type_t< Observable >(vn)...).concat(o))
 

Detailed Description

Returns an observable that sends each value in the collection, on the specified scheduler.

Template Parameters
Collectionthe type of the collection of values that this observable emits
Coordinationthe type of the scheduler (optional)
Parameters
ccollection containing values to send
cnthe scheduler to use for scheduling the items (optional)
Returns
Observable that sends each value in the collection.
Sample Code
std::array< int, 3 > a={{1, 2, 3}};
auto values = rxcpp::observable<>::iterate(a);
values.
[](int v){printf("OnNext: %d\n", v);},
[](){printf("OnCompleted\n");});
OnNext: 1
OnNext: 2
OnNext: 3
OnCompleted
Sample Code
std::array< int, 3 > a={{1, 2, 3}};
values.
[](int v){printf("OnNext: %d\n", v);},
[](){printf("OnCompleted\n");});
OnNext: 1
OnNext: 2
OnNext: 3
OnCompleted

Macro Definition Documentation

#define RXCPP_SOURCES_RX_ITERATE_HPP