21 #if !defined(RXCPP_OPERATORS_RX_ALL_HPP) 22 #define RXCPP_OPERATORS_RX_ALL_HPP 24 #include "../rx-includes.hpp" 33 struct all_invalid_arguments {};
37 using type =
observable<all_invalid_arguments<
AN...>, all_invalid<
AN...>>;
40 using all_invalid_t =
typename all_invalid<
AN...>::type;
42 template<
class T,
class Predicate>
49 typedef bool value_type;
56 template<
class Subscriber>
59 typedef all_observer<Subscriber> this_type;
60 typedef source_value_type value_type;
67 all_observer(dest_type d, test_type t)
73 void on_next(source_value_type v)
const {
75 return !this->test(v); },
77 if (filtered.empty()) {
80 if (filtered.get() && !done) {
86 void on_error(std::exception_ptr e)
const {
89 void on_completed()
const {
98 return make_subscriber<value_type>(d, this_type(d, std::move(t)));
102 template<
class Subscriber>
103 auto operator()(Subscriber dest)
const 104 -> decltype(all_observer<Subscriber>::make(std::move(dest), test)) {
105 return all_observer<Subscriber>::make(std::move(dest), test);
113 template<
class...
AN>
127 template<
class...
AN>
130 return operator_factory<is_empty_tag,
AN...>(std::make_tuple(std::forward<AN>(an)...));
138 template<
class Observable,
class Predicate,
142 class All = rxo::detail::all<SourceValue, rxu::decay_t<Predicate>>,
144 static auto member(Observable&& o, Predicate&& p)
145 -> decltype(o.template lift<Value>(All(std::forward<Predicate>(p)))) {
146 return o.template lift<Value>(All(std::forward<Predicate>(p)));
149 template<
class...
AN>
150 static operators::detail::all_invalid_t<
AN...>
member(
const AN&...) {
153 static_assert(
sizeof...(
AN) == 10000,
"all takes (Predicate)");
160 template<
class Observable,
163 is_observable<Observable>>,
164 class Predicate = std::function<bool(SourceValue)>,
165 class IsEmpty = rxo::detail::all<SourceValue, rxu::decay_t<Predicate>>,
168 -> decltype(o.template lift<Value>(IsEmpty(
nullptr))) {
169 return o.template lift<Value>(IsEmpty([](SourceValue) {
return false; }));
172 template<
class...
AN>
173 static operators::detail::all_invalid_t<
AN...>
member(
AN...) {
176 static_assert(
sizeof...(
AN) == 10000,
"is_empty takes no arguments");
Definition: rx-all.hpp:26
static operators::detail::all_invalid_t< AN... > member(const AN &...)
Definition: rx-all.hpp:150
typename std::decay< T >::type::value_type value_type_t
Definition: rx-util.hpp:35
Definition: rx-operators.hpp:69
auto AN
Definition: rx-finally.hpp:105
typename std::decay< T >::type decay_t
Definition: rx-util.hpp:36
Definition: rx-operators.hpp:47
auto is_empty(AN &&...an) -> operator_factory< is_empty_tag, AN... >
Returns an Observable that emits true if the source Observable is empty, otherwise false...
Definition: rx-all.hpp:128
Definition: rx-operators.hpp:117
typename std::enable_if< all_true_type< BN... >::value >::type enable_if_all_true_type_t
Definition: rx-util.hpp:114
a source of values. subscribe or use one of the operator methods that return a new observable...
Definition: rx-observable.hpp:510
static auto member(Observable &&o, Predicate &&p) -> decltype(o.template lift< Value >(All(std::forward< Predicate >(p))))
Definition: rx-all.hpp:144
static auto member(Observable &&o) -> decltype(o.template lift< Value >(IsEmpty(nullptr)))
Definition: rx-all.hpp:167
static operators::detail::all_invalid_t< AN... > member(AN...)
Definition: rx-all.hpp:173
Definition: rx-operators.hpp:110
consumes values from an observable using State that may implement on_next, on_error and on_completed ...
Definition: rx-observer.hpp:179
Definition: rx-operators.hpp:16
auto on_exception(const F &f, const OnError &c) -> typename std::enable_if< detail::is_on_error< OnError >::value, typename detail::maybe_from_result< F >::type >::type
Definition: rx-observer.hpp:639
binds an observer that consumes values with a composite_subscription that controls lifetime...
Definition: rx-subscriber.hpp:25
Definition: rx-predef.hpp:177
auto all(AN &&...an) -> operator_factory< all_tag, AN... >
Returns an Observable that emits true if every item emitted by the source Observable satisfies a spec...
Definition: rx-all.hpp:114