ReactivePlusPlus
ReactiveX implementation for C++20
Loading...
Searching...
No Matches
as_blocking.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
11
#pragma once
12
13
#include <rpp/observables/fwd.hpp>
14
#include <rpp/operators/fwd.hpp>
15
16
#include <rpp/observables/blocking_observable.hpp>
17
18
namespace
rpp::operators::details
19
{
20
struct
as_blocking_t
21
{
22
template
<rpp::constra
int
::decayed_type Type, rpp::constra
int
::observable_strategy<Type> Strategy>
23
auto
operator()(
rpp::observable<Type, Strategy>
&&
observable
)
const
24
{
25
return
rpp::blocking_observable<Type, Strategy>
{std::move(
observable
)};
26
}
27
28
template
<rpp::constra
int
::decayed_type Type, rpp::constra
int
::observable_strategy<Type> Strategy>
29
auto
operator()(
const
rpp::observable<Type, Strategy>
&
observable
)
const
30
{
31
return
rpp::blocking_observable<Type, Strategy>
{
observable
};
32
}
33
};
34
}
// namespace rpp::operators::details
35
36
namespace
rpp::operators
37
{
47
inline
auto
as_blocking
()
48
{
49
return
details::as_blocking_t
{};
50
}
51
}
// namespace rpp::operators
rpp::blocking_observable
Extension over rpp::observable with set of blocking operators - it waits till completion of underlyin...
Definition
fwd.hpp:176
rpp::observable
Base class for any observable used in RPP. It handles core callbacks of observable.
Definition
observable.hpp:38
rpp::operators::as_blocking
auto as_blocking()
Converts rpp::observable to rpp::blocking_observable
Definition
as_blocking.hpp:47
rpp::operators::details::as_blocking_t
Definition
as_blocking.hpp:21
src
rpp
rpp
operators
as_blocking.hpp
Generated by
1.12.0