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++.
rx-includes.hpp
Go to the documentation of this file.
1 // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2 
3 #pragma once
4 
5 #if !defined(RXCPP_RX_INCLUDES_HPP)
6 #define RXCPP_RX_INCLUDES_HPP
7 
8 #include "rx-trace.hpp"
9 
10 // some configuration macros
11 #if defined(_MSC_VER)
12 
13 #if _MSC_VER > 1600
14 #pragma warning(disable: 4348) // false positives on : redefinition of default parameter : parameter 2
15 #define RXCPP_USE_RVALUEREF 1
16 #endif
17 
18 #if _MSC_VER >= 1800
19 #define RXCPP_USE_VARIADIC_TEMPLATES 1
20 #endif
21 
22 #if _CPPRTTI
23 #define RXCPP_USE_RTTI 1
24 #endif
25 
26 #elif defined(__clang__)
27 
28 #if __has_feature(cxx_rvalue_references)
29 #define RXCPP_USE_RVALUEREF 1
30 #endif
31 #if __has_feature(cxx_rtti)
32 #define RXCPP_USE_RTTI 1
33 #endif
34 #if __has_feature(cxx_variadic_templates)
35 #define RXCPP_USE_VARIADIC_TEMPLATES 1
36 #endif
37 
38 #elif defined(__GNUG__)
39 
40 #define GCC_VERSION (__GNUC__ * 10000 + \
41  __GNUC_MINOR__ * 100 + \
42  __GNUC_PATCHLEVEL__)
43 
44 #if GCC_VERSION >= 40801
45 #define RXCPP_USE_RVALUEREF 1
46 #endif
47 
48 #if GCC_VERSION >= 40400
49 #define RXCPP_USE_VARIADIC_TEMPLATES 1
50 #endif
51 
52 #if defined(__GXX_RTTI)
53 #define RXCPP_USE_RTTI 1
54 #endif
55 
56 #endif
57 
58 //
59 // control std::hash<> of enum
60 // force with RXCPP_FORCE_HASH_ENUM & RXCPP_FORCE_HASH_ENUM_UNDERLYING
61 // in time use ifdef to detect library support for std::hash<> of enum
62 //
63 #define RXCPP_HASH_ENUM 0
64 #define RXCPP_HASH_ENUM_UNDERLYING 1
65 
66 #if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
67 #define RXCPP_USE_WINRT 0
68 #else
69 #define RXCPP_USE_WINRT 1
70 #endif
71 
72 #if defined(__APPLE__) && defined(__MACH__)
73 #include <TargetConditionals.h>
74 #if (TARGET_OS_IPHONE == 1) || (TARGET_IPHONE_SIMULATOR == 1)
75 #define RXCPP_ON_IOS
76 #endif
77 #endif
78 
79 #if defined(__ANDROID__)
80 #define RXCPP_ON_ANDROID
81 #endif
82 
83 #if defined(RXCPP_FORCE_USE_VARIADIC_TEMPLATES)
84 #undef RXCPP_USE_VARIADIC_TEMPLATES
85 #define RXCPP_USE_VARIADIC_TEMPLATES RXCPP_FORCE_USE_VARIADIC_TEMPLATES
86 #endif
87 
88 #if defined(RXCPP_FORCE_USE_RVALUEREF)
89 #undef RXCPP_USE_RVALUEREF
90 #define RXCPP_USE_RVALUEREF RXCPP_FORCE_USE_RVALUEREF
91 #endif
92 
93 #if defined(RXCPP_FORCE_USE_RTTI)
94 #undef RXCPP_USE_RTTI
95 #define RXCPP_USE_RTTI RXCPP_FORCE_USE_RTTI
96 #endif
97 
98 #if defined(RXCPP_FORCE_USE_WINRT)
99 #undef RXCPP_USE_WINRT
100 #define RXCPP_USE_WINRT RXCPP_FORCE_USE_WINRT
101 #endif
102 
103 #if defined(RXCPP_FORCE_HASH_ENUM)
104 #undef RXCPP_HASH_ENUM
105 #define RXCPP_HASH_ENUM RXCPP_FORCE_HASH_ENUM
106 #endif
107 
108 #if defined(RXCPP_FORCE_HASH_ENUM_UNDERLYING)
109 #undef RXCPP_HASH_ENUM_UNDERLYING
110 #define RXCPP_HASH_ENUM_UNDERLYING RXCPP_FORCE_HASH_ENUM_UNDERLYING
111 #endif
112 
113 #if defined(RXCPP_FORCE_ON_IOS)
114 #undef RXCPP_ON_IOS
115 #define RXCPP_ON_IOS RXCPP_FORCE_ON_IOS
116 #endif
117 
118 #if defined(RXCPP_FORCE_ON_ANDROID)
119 #undef RXCPP_ON_ANDROID
120 #define RXCPP_ON_ANDROID RXCPP_FORCE_ON_ANDROID
121 #endif
122 
123 #if defined(_MSC_VER) && !RXCPP_USE_VARIADIC_TEMPLATES
124 // resolve args needs enough to store all the possible resolved args
125 #define _VARIADIC_MAX 10
126 #endif
127 
128 #pragma push_macro("min")
129 #pragma push_macro("max")
130 #undef min
131 #undef max
132 
133 #include <stdlib.h>
134 
135 #include <cstddef>
136 
137 #include <iostream>
138 #include <iomanip>
139 
140 #include <exception>
141 #include <functional>
142 #include <memory>
143 #include <array>
144 #include <vector>
145 #include <algorithm>
146 #include <atomic>
147 #include <map>
148 #include <set>
149 #include <mutex>
150 #include <deque>
151 #include <thread>
152 #include <future>
153 #include <list>
154 #include <queue>
155 #include <chrono>
156 #include <condition_variable>
157 #include <initializer_list>
158 #include <typeinfo>
159 #include <tuple>
160 #include <unordered_set>
161 #include <type_traits>
162 #include <utility>
163 
164 #if defined(RXCPP_ON_IOS) || defined(RXCPP_ON_ANDROID)
165 #include <pthread.h>
166 #endif
167 
168 #include "rx-util.hpp"
169 #include "rx-predef.hpp"
170 #include "rx-subscription.hpp"
171 #include "rx-observer.hpp"
172 #include "rx-scheduler.hpp"
173 #include "rx-subscriber.hpp"
174 #include "rx-notification.hpp"
175 #include "rx-coordination.hpp"
176 #include "rx-sources.hpp"
177 #include "rx-subjects.hpp"
178 #include "rx-operators.hpp"
179 #include "rx-observable.hpp"
181 #include "rx-grouped_observable.hpp"
182 
183 #if !defined(RXCPP_LITE)
184 #include "operators/rx-all.hpp"
185 #include "operators/rx-amb.hpp"
186 #include "operators/rx-any.hpp"
191 #include "operators/rx-concat.hpp"
194 #include "operators/rx-debounce.hpp"
195 #include "operators/rx-delay.hpp"
196 #include "operators/rx-distinct.hpp"
199 #include "operators/rx-filter.hpp"
200 #include "operators/rx-finally.hpp"
201 #include "operators/rx-flat_map.hpp"
202 #include "operators/rx-group_by.hpp"
204 #include "operators/rx-map.hpp"
205 #include "operators/rx-merge.hpp"
208 #include "operators/rx-pairwise.hpp"
209 #include "operators/rx-reduce.hpp"
210 #include "operators/rx-repeat.hpp"
211 #include "operators/rx-replay.hpp"
212 #include "operators/rx-retry.hpp"
214 #include "operators/rx-scan.hpp"
216 #include "operators/rx-skip.hpp"
223 #include "operators/rx-take.hpp"
227 #include "operators/rx-tap.hpp"
229 #include "operators/rx-timeout.hpp"
231 #include "operators/rx-window.hpp"
236 #include "operators/rx-zip.hpp"
237 #endif
238 
239 #pragma pop_macro("min")
240 #pragma pop_macro("max")
241 
242 #endif
1) replay(optional Coordination, optional CompositeSubscription) Turn a cold observable hot...
For each item from this observable, filter out consequentially repeated values and emit only changes ...
Do not emit any items from the source Observable, but allow termination notification (either onError ...
Return an observable that terminates with timeout_error if a particular timespan has passed without e...
Return an observable that emits an item if a particular timespan has passed without emitting another ...
Returns an Observable that emits true if any item emitted by the source Observable satisfies a specif...
Returns an observable that attaches a timestamp to each item emitted by the source observable indicat...
Bring by one item from all given observables and select a value to emit from the new observable that ...
For each item from this observable, filter out repeated values and emit only items that have not alre...
Return an observable that emits connected, non-overlapping windows of items from the source observabl...
Retry this observable for the given number of times.
For the first count items from this observable emit them from the new observable that is returned...
For the first items fulfilling the predicate from this observable emit them from the new observable t...
For each item from this observable use the CollectionSelector to produce an observable and subscribe ...
Return observable that emits the items emitted by the observable most recently emitted by the source ...
inspect calls to on_next, on_error and on_completed.
For each item from this observable use Selector to produce an item to emit from the new observable th...
Return an observable that emits observables every period time interval and collects items from this o...
Subscription and unsubscription are queued and delivered using the scheduler from the supplied coordi...
Return an Observable that emits the most recent items emitted by the source Observable within periodi...
All values are queued and delivered using the scheduler from the supplied coordination.
Returns an observable that emits indications of the amount of time lapsed between consecutive emissio...
Repeat this observable for the given number of times or infinitely.
Start with the supplied values, then concatenate this observable.
Emit only the final t items emitted by the source Observable.
For each item from all of the observables select a value to emit from the new observable that is retu...
Return an observable that emits buffers every period time interval and collects items from this obser...
Return an observable that emits connected, non-overlapping windows, each containing at most count ite...
Pulls an item located at a specified index location in the sequence of items and emits that item as i...
For each given observable subscribe. For each item emitted from all of the given observables, deliver from the new observable that is returned.
For each item from this observable use Predicate to select which items to emit from the new observabl...
For each item from this observable use the CollectionSelector to produce an observable and subscribe ...
If an error occurs, take the result from the Selector and subscribe to that instead.
Return an observable that emits observables every period time interval and collects items from this o...
For each item from the first observable select the latest value from all the observables to emit from...
takes a connectable_observable source and calls connect during the construction of the expression...
If the source Observable terminates without emitting any items, emits items from a backup Observable...
For each item from this observable use Accumulator to combine items into a value that will be emitted...
Return an observable that emits each item emitted by the source observable after the specified delay...
Return an observable that emits connected, non-overlapping buffer, each containing at most count item...
Take values pairwise from this observable.
Make new observable with skipped last count items from this observable.
Return an observable that emits grouped_observables, each of which corresponds to a unique key value ...
Return an observable that emits connected, non-overlapping buffers of items from the source observabl...
Returns an Observable that emits true if every item emitted by the source Observable satisfies a spec...
Determine whether two Observables emit the same sequence of items.
Add a new action at the end of the new observable that is returned.
Make new observable with items skipped until on_next occurs on the trigger observable or until the sp...
For each item from this observable until on_next occurs on the trigger observable or until the specif...
For each item from this observable use Accumulator to combine items, when completed use ResultSelecto...
Make new observable with skipped first count items from this observable.
For each item from only the first of the given observables deliver from the new observable that is re...
For each item from this observable subscribe to one at a time, in the order received. For each item from all of the given observables deliver from the new observable that is returned.