ReactivePlusPlus
One more implementation of ReactiveX approach in C++ with care about performance and templates in mind
 
Loading...
Searching...
No Matches
rpp::dynamic_observer< Type > Class Template Referencefinal

Type-erased version of the rpp::observer. Any observer can be converted to dynamic_observer via rpp::observer::as_dynamic member function. More...

#include <dynamic_observer.hpp>

Inheritance diagram for rpp::dynamic_observer< Type >:
rpp::observer< Type, details::observers::dynamic_strategy< Type > > rpp::details::observer_impl< Type, Strategy, details::observers::deduce_disposable_strategy_t< Strategy > >

Public Member Functions

 dynamic_observer (base &&b)
 
 dynamic_observer (const base &b)
 
- Public Member Functions inherited from rpp::observer< Type, details::observers::dynamic_strategy< Type > >
 observer (DisposableStrategy strategy, Args &&... 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_disposable_strategy_t< Strategy > >
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

- Public Types inherited from rpp::observer< Type, details::observers::dynamic_strategy< Type > >
using DisposableStrategy
 
using Base
 
- Public Types inherited from rpp::details::observer_impl< Type, Strategy, details::observers::deduce_disposable_strategy_t< Strategy > >
using preferred_disposable_strategy
 
using on_next_lvalue
 
using on_next_rvalue
 
- Protected Member Functions inherited from rpp::details::observer_impl< Type, Strategy, details::observers::deduce_disposable_strategy_t< Strategy > >
 observer_impl (DisposablesStrategy strategy, Args &&... args)
 

Detailed Description

template<constraint::decayed_type Type>
class rpp::dynamic_observer< Type >

Type-erased version of the rpp::observer. Any observer can be converted to dynamic_observer via rpp::observer::as_dynamic member function.

To provide type-erasure it uses std::shared_ptr. As a result it has worse performance, but it is ONLY way to copy observer.

Template Parameters
Typeof value this observer can handle

The documentation for this class was generated from the following file: