// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. #pragma once #if !defined(RXCPP_RX_OPERATORS_HPP) #define RXCPP_RX_OPERATORS_HPP #include "rx-includes.hpp" namespace rxcpp { namespace operators { struct tag_operator {}; template struct operator_base { typedef T value_type; typedef tag_operator operator_tag; }; namespace detail { template struct is_operator : std::false_type { }; template struct is_operator> : std::is_convertible { }; } template> struct is_operator : detail::is_operator { }; } namespace rxo=operators; template struct member_overload { template static auto member(AN&&...) -> typename Tag::template include_header { return typename Tag::template include_header(); } }; template struct delayed_type{using value_type = T; static T value(AN**...) {return T{};}}; template using delayed_type_t = rxu::value_type_t>; template>> auto observable_member(Tag, AN&&... an) -> decltype(Overload::member(std::forward(an)...)) { return Overload::member(std::forward(an)...); } template class operator_factory { using this_type = operator_factory; using tag_type = rxu::decay_t; using tuple_type = std::tuple...>; tuple_type an; public: operator_factory(tuple_type an) : an(std::move(an)) { } template auto operator()(tag_type t, ZN&&... zn) const -> decltype(observable_member(t, std::forward(zn)...)) { return observable_member(t, std::forward(zn)...); } template auto operator()(Observable source) const -> decltype(rxu::apply(std::tuple_cat(std::make_tuple(tag_type{}, source), (*(tuple_type*)nullptr)), (*(this_type*)nullptr))) { return rxu::apply(std::tuple_cat(std::make_tuple(tag_type{}, source), an), *this); } }; } #include "operators/rx-lift.hpp" #include "operators/rx-subscribe.hpp" namespace rxcpp { struct amb_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct all_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct is_empty_tag : all_tag {}; struct any_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct exists_tag : any_tag {}; struct contains_tag : any_tag {}; struct buffer_count_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct buffer_with_time_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct buffer_with_time_or_count_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct combine_latest_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct concat_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct concat_map_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct connect_forever_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct debounce_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct delay_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct distinct_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct distinct_until_changed_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct element_at_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct filter_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct finally_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct flat_map_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct group_by_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct ignore_elements_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct map_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct merge_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct merge_delay_error_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct multicast_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct observe_on_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct on_error_resume_next_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; class empty_error: public std::runtime_error { public: explicit empty_error(const std::string& msg): std::runtime_error(msg) {} }; struct reduce_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct first_tag : reduce_tag {}; struct last_tag : reduce_tag {}; struct sum_tag : reduce_tag {}; struct average_tag : reduce_tag {}; struct min_tag : reduce_tag {}; struct max_tag : reduce_tag {}; struct ref_count_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct pairwise_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct publish_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct publish_synchronized_tag : publish_tag {}; struct repeat_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct replay_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct retry_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct sample_with_time_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct scan_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct sequence_equal_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct skip_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct skip_while_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct skip_last_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct skip_until_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct start_with_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct subscribe_on_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct switch_if_empty_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct default_if_empty_tag : switch_if_empty_tag {}; struct switch_on_next_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct take_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct take_last_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct take_while_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct take_until_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct tap_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct timeout_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct time_interval_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct timestamp_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct window_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct window_with_time_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct window_with_time_or_count_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct window_toggle_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct with_latest_from_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; struct zip_tag { template struct include_header{ static_assert(Included::value, "missing include: please #include "); }; }; } #include "operators/rx-multicast.hpp" #include "operators/rx-publish.hpp" #include "operators/rx-ref_count.hpp" #endif