ReactivePlusPlus
ReactiveX implementation for C++20
|
Base class for any observer used in RPP. It handles core callbacks of observers. Objects of this class would be passed to subscribe of observable. More...
Public Types | |
using | DisposableStrategy = details::observers::deduce_optimal_disposables_strategy_t<Strategy::preferred_disposables_mode> |
using | Base = details::observer_impl<Type, Strategy, DisposableStrategy> |
Public Types inherited from rpp::details::observer_impl< Type, Strategy, details::observers::deduce_optimal_disposables_strategy_t< Strategy::preferred_disposables_mode > > | |
using | on_next_lvalue |
using | on_next_rvalue |
Public Member Functions | |
template<typename... Args> requires constraint::is_constructible_from<Strategy, Args&&...> | |
observer (DisposableStrategy strategy, Args &&... args) | |
template<typename... Args> requires (constraint::is_constructible_from<Strategy, Args && ...> && !rpp::constraint::variadic_decayed_same_as<observer, Args...>) | |
observer (Args &&... args) | |
observer (const observer &)=delete | |
observer (observer &&) noexcept=default | |
dynamic_observer< Type > | as_dynamic () && |
Convert current observer to type-erased version. Useful if you need to COPY your observer or to store different observers in same container. | |
Public Member Functions inherited from rpp::details::observer_impl< Type, Strategy, details::observers::deduce_optimal_disposables_strategy_t< Strategy::preferred_disposables_mode > > | |
void | set_upstream (const disposable_wrapper &d) noexcept |
Observable calls this method to pass disposable. Observer disposes this disposable WHEN observer wants to unsubscribe. | |
bool | is_disposed () const noexcept |
Observable calls this method to check if observer interested or not in emissions. | |
void | on_next (const Type &v) const noexcept |
Observable calls this method to notify observer about new value. | |
void | on_next (Type &&v) const noexcept |
Observable calls this method to notify observer about new value. | |
void | on_error (const std::exception_ptr &err) const noexcept |
Observable calls this method to notify observer about some error during generation next data. | |
void | on_completed () const noexcept |
Observable calls this method to notify observer about completion of emissions. | |
Additional Inherited Members | |
Static Public Attributes inherited from rpp::details::observer_impl< Type, Strategy, details::observers::deduce_optimal_disposables_strategy_t< Strategy::preferred_disposables_mode > > | |
static constexpr auto | preferred_disposables_mode |
Protected Member Functions inherited from rpp::details::observer_impl< Type, Strategy, details::observers::deduce_optimal_disposables_strategy_t< Strategy::preferred_disposables_mode > > | |
observer_impl (DisposablesStrategy strategy, Args &&... args) | |
Base class for any observer used in RPP. It handles core callbacks of observers. Objects of this class would be passed to subscribe of observable.
Type | of value this observer can handle |
Strategy | used to provide logic over observer's callbacks |