24 #if !defined(RXCPP_OPERATORS_RX_REPEAT_HPP)
25 #define RXCPP_OPERATORS_RX_REPEAT_HPP
27 #include "../rx-includes.hpp"
37 struct repeat_invalid_arguments {};
40 struct repeat_invalid :
public rxo::operator_base<repeat_invalid_arguments<AN...>> {
41 using type = observable<repeat_invalid_arguments<
AN...>, repeat_invalid<
AN...>>;
44 using repeat_invalid_t =
typename repeat_invalid<
AN...>::type;
48 struct event_handlers {
49 template <
typename State>
51 state->out.on_error(e);
54 template <
typename State>
55 static inline void on_completed(State& state) {
58 if (state->completed_predicate()) {
59 state->out.on_completed();
61 state->do_subscribe();
67 template <
class T,
class Observable,
class Count>
68 using finite = ::rxcpp::operators::detail::retry_repeat_common::finite
69 <event_handlers, T, Observable, Count>;
72 template <
class T,
class Observable>
73 using infinite = ::rxcpp::operators::detail::retry_repeat_common::infinite
74 <event_handlers, T, Observable>;
91 template<
class Observable,
94 class Repeat = rxo::detail::repeat::infinite<SourceValue, rxu::decay_t<Observable>>,
97 static Result
member(Observable&& o) {
98 return Result(Repeat(std::forward<Observable>(o)));
101 template<
class Observable,
105 class Repeat = rxo::detail::repeat::finite<SourceValue, rxu::decay_t<Observable>,
rxu::decay_t<Count>>,
108 static Result
member(Observable&& o, Count&& c) {
109 return Result(Repeat(std::forward<Observable>(o), std::forward<Count>(c)));
112 template<
class...
AN>
113 static operators::detail::repeat_invalid_t<
AN...>
member(
AN...) {
116 static_assert(
sizeof...(
AN) == 10000,
"repeat takes (optional Count)");