ReactivePlusPlus
ReactiveX implementation for C++20
Loading...
Searching...
No Matches
interface_composite_disposable.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/disposables/callback_disposable.hpp>
14
#include <rpp/disposables/interface_disposable.hpp>
15
16
namespace
rpp
17
{
18
struct
interface_composite_disposable
:
public
interface_disposable
19
{
20
virtual
void
add(
disposable_wrapper
disposable) = 0;
21
22
template
<rpp::constra
int
::is_nothrow_invocable Fn>
23
disposable_wrapper
add(Fn&& invocable)
24
{
25
auto
d = make_callback_disposable(std::forward<Fn>(invocable));
26
add(d);
27
return
d;
28
}
29
30
virtual
void
remove(
const
disposable_wrapper
& d) = 0;
31
// dispose all added disposables, clear container but not dispose original disposable
32
virtual
void
clear() = 0;
33
};
34
}
// namespace rpp
rpp::disposable_wrapper_impl< interface_disposable >
rpp::interface_composite_disposable
Definition
interface_composite_disposable.hpp:19
rpp::interface_disposable
Interface of disposable.
Definition
interface_disposable.hpp:23
src
rpp
rpp
disposables
interface_composite_disposable.hpp
Generated by
1.12.0