5 #if !defined(RXCPP_RX_CONNECTABLE_OBSERVABLE_HPP) 6 #define RXCPP_RX_CONNECTABLE_OBSERVABLE_HPP 19 static auto check(
int) -> decltype((*(CT*)
nullptr).on_connect(composite_subscription()));
21 static not_void check(...);
23 typedef decltype(check<T>(0)) detail_result;
24 static const bool value = std::is_same<detail_result, void>::value;
34 :
public std::enable_shared_from_this<state_type>
36 typedef std::function<void(composite_subscription)> onconnect_type;
38 onconnect_type on_connect;
40 std::shared_ptr<state_type> state;
49 state = std::move(o.state);
54 auto so = std::make_shared<rxu::decay_t<SO>>(std::forward<SO>(source));
56 so->on_connect(std::move(cs));
71 , state(std::make_shared<state_type>())
73 construct(std::move(sof),
77 template<
class SF,
class CF>
80 , state(std::make_shared<state_type>())
82 state->on_connect = std::forward<CF>(cf);
88 state->on_connect(std::move(cs));
92 template<
class T,
class Source>
104 template<
class T,
class SourceOperator>
112 static_assert(detail::has_on_connect<source_operator_type>::value,
"inner must have on_connect method void(composite_subscription)");
126 : base_type(std::move(o))
138 : base_type(std::move(o))
146 template<
class OperatorFactory>
147 auto op(OperatorFactory&& of) const
148 -> decltype(of(*(const this_type*)
nullptr)) {
161 base_type::source_operator.on_connect(cs);
167 template<
class...
AN>
178 template<
class...
AN>
195 template<
class T,
class SourceOperator,
class OperatorFactory>
197 -> decltype(source.op(std::forward<OperatorFactory>(of))) {
198 return source.op(std::forward<OperatorFactory>(of));
205 template<
class T,
class SourceOperator,
class OperatorFactory>
207 -> decltype(source.op(std::forward<OperatorFactory>(of))) {
208 return source.op(std::forward<OperatorFactory>(of));
Definition: rx-predef.hpp:220
auto connect_forever(AN...an) const
takes a connectable_observable source and calls connect during the construction of the expression...
Definition: rx-connectable_observable.hpp:179
Definition: rx-operators.hpp:171
a source of values that is shared across all subscribers and does not start until connectable_observa...
Definition: rx-connectable_observable.hpp:105
Definition: rx-all.hpp:26
dynamic_connectable_observable()
Definition: rx-connectable_observable.hpp:64
connectable_observable< T > make_dynamic_connectable_observable(Source &&s)
Definition: rx-connectable_observable.hpp:93
controls lifetime for scheduler::schedule and observable<T, SourceOperator>::subscribe.
Definition: rx-subscription.hpp:364
tag_connectable_observable observable_tag
Definition: rx-connectable_observable.hpp:112
auto ref_count(AN...an) const
takes a connectable_observable source and uses a ref_count of the subscribers to control the connecti...
Definition: rx-connectable_observable.hpp:168
auto operator>>(const rxcpp::connectable_observable< T, SourceOperator > &source, OperatorFactory &&of) -> decltype(source.op(std::forward< OperatorFactory >(of)))
Definition: rx-connectable_observable.hpp:196
tag_dynamic_observable dynamic_observable_tag
Definition: rx-connectable_observable.hpp:62
Definition: rx-operators.hpp:303
connectable_observable(connectable_observable< T, SO > &&o)
Definition: rx-connectable_observable.hpp:137
auto AN
Definition: rx-finally.hpp:105
typename std::decay< T >::type decay_t
Definition: rx-util.hpp:36
Definition: rx-sources.hpp:15
auto operator|(const rxcpp::connectable_observable< T, SourceOperator > &source, OperatorFactory &&of) -> decltype(source.op(std::forward< OperatorFactory >(of)))
Definition: rx-connectable_observable.hpp:206
Definition: rx-observable.hpp:36
connectable_observable< T > as_dynamic()
Definition: rx-connectable_observable.hpp:156
auto op(OperatorFactory &&of) const -> decltype(of(*(const this_type *) nullptr))
Definition: rx-connectable_observable.hpp:147
composite_subscription connect(composite_subscription cs=composite_subscription())
Definition: rx-connectable_observable.hpp:160
a source of values. subscribe or use one of the operator methods that return a new observable...
Definition: rx-observable.hpp:510
dynamic_connectable_observable(SOF sof)
Definition: rx-connectable_observable.hpp:69
connectable_observable()
Definition: rx-connectable_observable.hpp:117
Definition: rx-connectable_observable.hpp:30
Definition: rx-predef.hpp:270
dynamic_connectable_observable(SF &&sf, CF &&cf)
Definition: rx-connectable_observable.hpp:78
void on_connect(composite_subscription cs) const
Definition: rx-connectable_observable.hpp:87
connectable_observable(SourceOperator &&o)
Definition: rx-connectable_observable.hpp:125
connectable_observable(const SourceOperator &o)
Definition: rx-connectable_observable.hpp:121
auto observable_member(Tag, AN &&...an) -> decltype(Overload::member(std::forward< AN >(an)...))
Definition: rx-operators.hpp:63
Definition: rx-predef.hpp:128
connectable_observable(const connectable_observable< T, SO > &o)
Definition: rx-connectable_observable.hpp:132
Definition: rx-predef.hpp:126