summaryrefslogtreecommitdiff
path: root/Rx/v2/src/rxcpp/rx-observable.hpp
diff options
context:
space:
mode:
authorGrigoriy Chudnov <g.chudnov@gmail.com>2017-01-10 12:55:20 +0300
committerKirk Shoop <kirk.shoop@microsoft.com>2017-01-10 08:14:03 -0800
commit13d406282a025f799f7674513dc2222f68d15dd4 (patch)
tree045a49c6cd0ce6030f81bb1c58a975e350a926cc /Rx/v2/src/rxcpp/rx-observable.hpp
parent37ab993f9f364f22f361a228bac988d6c798f3d2 (diff)
downloadRxCpp-13d406282a025f799f7674513dc2222f68d15dd4.tar.gz
decouple window_toggle from observable
Diffstat (limited to 'Rx/v2/src/rxcpp/rx-observable.hpp')
-rw-r--r--Rx/v2/src/rxcpp/rx-observable.hpp51
1 files changed, 7 insertions, 44 deletions
diff --git a/Rx/v2/src/rxcpp/rx-observable.hpp b/Rx/v2/src/rxcpp/rx-observable.hpp
index 01ceb88..81a626a 100644
--- a/Rx/v2/src/rxcpp/rx-observable.hpp
+++ b/Rx/v2/src/rxcpp/rx-observable.hpp
@@ -1030,52 +1030,15 @@ public:
return observable_member(window_with_time_or_count_tag{}, *this, std::forward<AN>(an)...);
}
- /*! Return an observable that emits observables every period time interval and collects items from this observable for period of time into each produced observable, on the specified scheduler.
-
- \tparam Openings observable<OT>
- \tparam ClosingSelector a function of type observable<CT>(OT)
- \tparam Coordination the type of the scheduler
-
- \param opens each value from this observable opens a new window.
- \param closes this function is called for each opened window and returns an observable. the first value from the returned observable will close the window
- \param coordination the scheduler for the windows
-
- \return Observable that emits an observable for each opened window.
-
- \sample
- \snippet window.cpp window toggle+coordination sample
- \snippet output.txt window toggle+coordination sample
+ /*! @copydoc rx-window_toggle.hpp
*/
- template<class Openings, class ClosingSelector, class Coordination, class Reqiures = typename rxu::types_checked_from<typename Coordination::coordination_tag>::type>
- auto window_toggle(Openings opens, ClosingSelector closes, Coordination coordination) const
- /// \cond SHOW_SERVICE_MEMBERS
- -> decltype(EXPLICIT_THIS lift<observable<T>>(rxo::detail::window_toggle<T, Openings, ClosingSelector, Coordination>(opens, closes, coordination)))
- /// \endcond
- {
- return lift<observable<T>>(rxo::detail::window_toggle<T, Openings, ClosingSelector, Coordination>(opens, closes, coordination));
- }
-
- /*! Return an observable that emits connected, non-overlapping windows represending items emitted by the source observable during fixed, consecutive durations.
-
- \tparam Openings observable<OT>
- \tparam ClosingSelector a function of type observable<CT>(OT)
-
- \param opens each value from this observable opens a new window.
- \param closes this function is called for each opened window and returns an observable. the first value from the returned observable will close the window
-
- \return Observable that emits an observable for each opened window.
-
- \sample
- \snippet window.cpp window toggle sample
- \snippet output.txt window toggle sample
- */
- template<class Openings, class ClosingSelector>
- auto window_toggle(Openings opens, ClosingSelector closes) const
- /// \cond SHOW_SERVICE_MEMBERS
- -> decltype(EXPLICIT_THIS lift<observable<T>>(rxo::detail::window_toggle<T, Openings, ClosingSelector, identity_one_worker>(opens, closes, identity_current_thread())))
- /// \endcond
+ template<class... AN>
+ auto window_toggle(AN&&... an) const
+ /// \cond SHOW_SERVICE_MEMBERS
+ -> decltype(observable_member(window_toggle_tag{}, *(this_type*)nullptr, std::forward<AN>(an)...))
+ /// \endcond
{
- return lift<observable<T>>(rxo::detail::window_toggle<T, Openings, ClosingSelector, identity_one_worker>(opens, closes, identity_current_thread()));
+ return observable_member(window_toggle_tag{}, *this, std::forward<AN>(an)...);
}
/*! @copydoc rx-buffer_count.hpp