ReactivePlusPlus
ReactiveX implementation for C++20
Loading...
Searching...
No Matches
dynamic_connectable_observable.hpp
1// ReactivePlusPlus library
2//
3// Copyright Aleksey Loginov 2023 - present.
4// Distributed under the Boost Software License, Version 1.0.
5// (See accompanying file LICENSE_1_0.txt or copy at
6// https://www.boost.org/LICENSE_1_0.txt)
7//
8// Project home: https://github.com/victimsnino/ReactivePlusPlus
9
10#pragma once
11
12#include <rpp/observables/connectable_observable.hpp>
13#include <rpp/observables/dynamic_observable.hpp>
14
15namespace rpp
16{
17 template<typename Subject>
18 class dynamic_connectable_observable final : public connectable_observable<rpp::dynamic_observable<rpp::subjects::utils::extract_subject_type_t<Subject>>, Subject>
19 {
20 public:
22
23 using base = connectable_observable<rpp::dynamic_observable<rpp::subjects::utils::extract_subject_type_t<Subject>>, Subject>;
24
25 using base::base;
26
27 template<rpp::constraint::observable_strategy<rpp::subjects::utils::extract_subject_type_t<Subject>> Strategy>
29 dynamic_connectable_observable(const rpp::connectable_observable<Strategy, Subject>& original)
30 : dynamic_connectable_observable{original.as_dynamic_connectable()}
31 {
32 }
33
34 template<rpp::constraint::observable_strategy<rpp::subjects::utils::extract_subject_type_t<Subject>> Strategy>
36 dynamic_connectable_observable(rpp::connectable_observable<Strategy, Subject>&& original)
37 : dynamic_connectable_observable{std::move(original).as_dynamic_connectable()}
38 {
39 }
40 };
41} // namespace rpp
Extension over raw observable with ability to be manually connected at any time or ref_counting (shar...
Definition connectable_observable.hpp:73
Definition constraints.hpp:19
Definition fwd.hpp:47